InterviewSolution
| 1. |
Solve : PHP MySQL code for deleting items in cart doesnt work0? |
||||
|
Answer» i am making php mysql code for admin side to delete ITEMS from shopping cart.Please FIND the error in the code , cause i cant find it.
} else header('location: adminlogin.php'); } else header('location: adminlogin.php'); ?> include 'footer.php'; ?> 2) Delete product 1 doesn’t work as there is some error in the code. Please remove the errors please. Here is the not working code of delete product 1. : http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> http://www.w3.org/1999/xhtml"> Delete Product Details function clearText(field) { if (field.defaultValue == field.value) field.value = ''; else if (field.value == '') field.value = field.defaultValue; } include 'header.php'; ?> Delete Product Details if(isset($_SESSION['uname'])) { include 'dbconnect.php'; echo "Welcome ".$_SESSION['uname'].","; ?> if($_SESSION['utype']=='A' ) { ?> if(isset($_POST['txtPName'])) { include 'dbconnect.php'; $txtPName=$_POST['txtPName']; try { $sql="delete from product where idProduct=:idProduct"; $q = $dbconn->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY)); $q->execute(array(':idProduct'=>$txtPName)); echo " Product ID : $txtPName one quantity deleted"; include 'footer.php'; ?> [recovering disk space, attachment deleted by admin] |
|||||