multiple values into one query
Posted: Mon Nov 30, 2009 10:08 pm
Okay I may have described the title wrong but here is what I am doing and I know how its suppose to work but I can't get it to work right.
Its a simple shopping cart I created and everything is prefect but it needs to submit multiple items to the cart at one time so say I need a hat and mittens, I add item id 1 and 2 to cart at the same time. Simple right? not totally...
Here is the code for submitting it:
Now when it posts to cart.php for just one item it comes out like this, and its suppose to this way
cart.php?action=add&id=3
Okay now when I use the drop downs and add two items at one time I get
cart.php?action=add&id=3&id=2
Its suppose to come out like this
cart.php?action=add&id=1,2,3
Am I crazy, is this even possible... somebody help me here!! Thanks in advance!
Its a simple shopping cart I created and everything is prefect but it needs to submit multiple items to the cart at one time so say I need a hat and mittens, I add item id 1 and 2 to cart at the same time. Simple right? not totally...
Here is the code for submitting it:
Code: Select all
<form action="cart.php" action="POST">
<input type="hidden" name="action" value="add">
<select name="id">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select><br /><br />
<select name="id">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select><br /><br />
<input type="submit" value="submit">
</form>cart.php?action=add&id=3
Okay now when I use the drop downs and add two items at one time I get
cart.php?action=add&id=3&id=2
Its suppose to come out like this
cart.php?action=add&id=1,2,3
Am I crazy, is this even possible... somebody help me here!! Thanks in advance!