Insert :
$addproduit = 'INSERT INTO name_table(`name`) VALUES (:name,)';
$addproduits = $db_con->prepare($addproduit)->execute(array(
"name" => $_POST["name"],
));
Select :
$q = 'SELECT * FROM name_table WHERE name_column = :name_column2 ';
$qu = $db_con->prepare($q);
$qu->execute(array(
"name_column2" => $_SESSION["userData"]["id"]
));
$clientdata = $qu->fetchAll();
Update :
$updateclient = 'UPDATE name_table SET name_column = :name_column1 WHERE
name_column = :name_column2 ';
$update = $db_con->prepare($updateclient)->execute(array(
"name_column1" => $_POST["fullname"],
"name_column2" => $_GET["id"],
));
Deleted :
$deleteClient = 'DELETE FROM name_table WHERE name_column = :name_column1 ';
$deleteClients = $db_con->prepare($deleteClient);
$res = $deleteClients->execute(array(
"name_column1" => $_REQUEST["id"],
));
Upload Picture :
$uploaddir = './picturesProduit/' ; // ( ./picturesProduit/ => is the name of
the file we uploded in him the picture )
$uploadfile = $uploaddir . basename($_FILES["image"]['name']);
if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile)) {
$uploadimage = True;
}; // if image is uploaded succefly in the dossier $uploadimage become TRUE
// $_FILES["image"]["name"] => This is the source of image for used .