karthikanov24 Posted September 14, 2009 Share Posted September 14, 2009 hi In the following function, to modify a product in a shopping cart, function modifyProduct() { $productId = (int)$_GET['productId']; $catId = $_POST['cboCategory']; $name = $_POST['txtName']; $description = $_POST['mtxDescription']; $price = str_replace(',', '', $_POST['txtPrice']); $qty = $_POST['txtQty']; $images = uploadProductImage('fleImage', SRV_ROOT . 'images/product/'); $mainImage = $images['image']; $thumbnail = $images['thumbnail']; //echo $thumbnail; // if uploading a new image // remove old image if ($mainImage != '') { _deleteImage($productId); $mainImage = "'$mainImage'"; $thumbnail = "'$thumbnail'"; } else { // if we're not updating the image // make sure the old path remain the same // in the database $mainImage = 'pd_image'; $thumbnail = 'pd_thumbnail'; } $sql = "UPDATE tbl_product SET cat_id = $catId, pd_name = '$name', pd_description = '$description', pd_price = $price, pd_qty = $qty, pd_image = $mainImage, pd_thumbnail = $thumbnail WHERE pd_id = $productId"; $result = dbQuery($sql); header('Location: index.php'); } At the following lines of code, $mainImage = "'$mainImage'"; $thumbnail = "'$thumbnail'"; why $mainimage is inside double quotes ? Link to comment https://forums.phpfreaks.com/topic/174211-modify-product/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.