I need to create a form using multiple quantities that can be updated by one
single update.
eg:
(HTML PAGE)
<form method="post" enctype = "multipart/formdata">
<? do { ?>
<?php echo $row_rsBasket['id']; ?>
<input name="qty" type="text" value="<?php echo $row_rsBasket['qty']; ?>"
size="3">
<? } while ($row_rsBasket = mysql_fetch_ass oc($rsBasket)); ?>
<input type="hidden" name="send" value="true">
<input type ="submit" name = "update" value ="update">
How do I create the multiple update when the page is submitted back to
itself?
(TOP OF THE HTML PAGE)
<?
if(isset($_POST['update']) && ($_POST['update'] == "true")){
//loop thorugh each of the submitted qty values this is where I am stuck!!
for each(){
mysql_query = "UPDATE tblCart SET qty = $_POST['qty'] WHERE id = 'ID' // not
sure how to pull out 'ID'
}
}
?>
Any help will be grateful
Craig
single update.
eg:
(HTML PAGE)
<form method="post" enctype = "multipart/formdata">
<? do { ?>
<?php echo $row_rsBasket['id']; ?>
<input name="qty" type="text" value="<?php echo $row_rsBasket['qty']; ?>"
size="3">
<? } while ($row_rsBasket = mysql_fetch_ass oc($rsBasket)); ?>
<input type="hidden" name="send" value="true">
<input type ="submit" name = "update" value ="update">
How do I create the multiple update when the page is submitted back to
itself?
(TOP OF THE HTML PAGE)
<?
if(isset($_POST['update']) && ($_POST['update'] == "true")){
//loop thorugh each of the submitted qty values this is where I am stuck!!
for each(){
mysql_query = "UPDATE tblCart SET qty = $_POST['qty'] WHERE id = 'ID' // not
sure how to pull out 'ID'
}
}
?>
Any help will be grateful
Craig
Comment