sorry for my confusing question.
let me rephrase the details:
$query = "SELECT * FROM table";
sample data:
Item Name: Quantity:
Coke 2
Pepsi 3
Gatorade 4
<form action="exec.php" method="POST">
<input type="hidden" name="item_name" value="<?php for each loop goes here?/>"
<input type="hidden" name="quantity" value="<?php for each loop goes here?/>"
<input type="submit" name="submit"/>
</form>
Now, in my exec.php page.
if(isset($_POST[‘submit’])){
$item_code =$_POST[‘item_code’];
$quantity =$_POST[‘quantity’];
$test= explode(‘\n’,$item_code);
$test2 = explode(‘\t’,$quantity);
this part is where my problem is..
here is my update query:
foreach($item as $test){
$update = “UPDATE table SET quantity=’$quantity’ WHERE item_code=’$item_code'”
}
}
as you can see, $quantity will be left out, since it would also need to be looped to match the $item_code.
or is there any better way to do this?
im quite new to php, so please pardon me if im doing it wrong the way..
I dont understand, do you have an issue reading the data from
MySQL? do you have an issue updating the data toMySQL? In any case it seems that you are refering aSQLissue rather than anHTMLorPHP, can you post yourSQLscript?