heyy... i need to knw how to update many values from one submit. problem is i have 10 fields and every text field has same table field value.assume that my 10 fields have 10 quantity values. i need to update quantity field by all 10 fields. like this ; 10 different items quantity should be update by clicking on submit button.(User select 10 different items from each combo boxes and enter quantity for each appropriate text field.)
I NEED is how to write query for this... please Help..
Kadafiz
0
Light Poster
Recommended Answers
Jump to PostYou should have a different name for each field. When you retrieve the values update them using the name. For example, if you have a field with name 'product123' the query should be something like this:
$quantity = $_POST['product123']; mysql_query("Update products set amount = $quantity where idproduct …
Jump to Postwhere is for loop? I can't see it in your code!
Jump to PostIn the html part you may have fields with different names, so when they are sent the names are the key, this is the form.html
<form action="handler.php" method="post"> <input type="text" name="product1"> <input type="text" name="product2"> <input type="text" name="product3"> <input type="submit" name="submitButton">
When the form is sent the php …
Jump to Postheyy thnxxxzz... itz worky bt i dont need to get all fields in the form.. there are another text fields also. thn how i get only set of text fields that i want.
Looping in this case is impractical because you will need a lot if if..else if..
Just retrieve …
Jump to Poststart your own thread and use code tags
All 20 Replies
Huakalero
0
Newbie Poster
Kadafiz
0
Light Poster
Kadafiz
0
Light Poster
Stefano Mtangoo
455
Senior Poster
Kadafiz
0
Light Poster
Huakalero
0
Newbie Poster
Kadafiz
0
Light Poster
Stefano Mtangoo
455
Senior Poster
shine2010
0
Newbie Poster
Stefano Mtangoo
455
Senior Poster
Huakalero
0
Newbie Poster
shine2010
0
Newbie Poster
Huakalero
0
Newbie Poster
shine2010
0
Newbie Poster
Huakalero
0
Newbie Poster
shine2010
0
Newbie Poster
Huakalero
0
Newbie Poster
shine2010
0
Newbie Poster
shine2010
0
Newbie Poster
Huakalero
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.