Jenny Dithe
11-17-2010, 03:22 PM
Hi,
I have a checkbox form which is sent to my insert page, which looks like:
if ($_REQUEST['product1'] !=''){
$sql="UPDATE products SET product1 ='requested'
WHERE client='{$_SESSION['client']}'";
mysql_query($sql,$con) or die(mysql_error());}
if ($_REQUEST['product2'] !=''){
$sql="UPDATE products SET product2 ='requested'
WHERE client='{$_SESSION['client']}'";
mysql_query($sql,$con) or die(mysql_error());}
if ($_REQUEST['product3'] !=''){
$sql="UPDATE products SET product3 ='requested'
WHERE client='{$_SESSION['client']}'";
mysql_query($sql,$con) or die(mysql_error());}
But if only product2 is selected, all three still update as requested. I have no idea what is going wrong.
I have a checkbox form which is sent to my insert page, which looks like:
if ($_REQUEST['product1'] !=''){
$sql="UPDATE products SET product1 ='requested'
WHERE client='{$_SESSION['client']}'";
mysql_query($sql,$con) or die(mysql_error());}
if ($_REQUEST['product2'] !=''){
$sql="UPDATE products SET product2 ='requested'
WHERE client='{$_SESSION['client']}'";
mysql_query($sql,$con) or die(mysql_error());}
if ($_REQUEST['product3'] !=''){
$sql="UPDATE products SET product3 ='requested'
WHERE client='{$_SESSION['client']}'";
mysql_query($sql,$con) or die(mysql_error());}
But if only product2 is selected, all three still update as requested. I have no idea what is going wrong.