D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
lampp
/
htdocs
/
admin
/
Filename :
edit_PDO.php
back
Copy
<?php require_once ('db.php'); $get_id=$_REQUEST['product_id']; $moveFile = move_uploaded_file($_FILES["image"]["tmp_name"],"uploads/" . $_FILES["image"]["name"]); $product_img = $_FILES["image"]["name"]; $product_title = $_POST['product_title']; $product_desc=$_POST['product_desc']; // if($moveFile){ // echo "Successfully Move!!!'"; // } $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "UPDATE add_product SET product_img ='$product_img',product_title='$product_title',product_desc='$product_desc' WHERE product_id = '$get_id' "; $conn->exec($sql); echo "<script>alert('Successfully Updated!!!'); window.location='index.php'</script>"; ?>