jwk811 Posted February 11, 2007 Share Posted February 11, 2007 I have products shown in my admin pages and they are shown listed in a form so each detail (price, name, etc.) is shown as a text input.. if i do this they will all have the same name when i submit it to update.. i figured i could make it an array somehow and then use foreach or implode to get it all and update it to the db like that.. understand? any help? thanks! Quote Link to comment Share on other sites More sharing options...
Yesideez Posted February 11, 2007 Share Posted February 11, 2007 Not sure I understand that at all... Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 11, 2007 Share Posted February 11, 2007 In the form, you need to associate each detail with the ID, then do a WHERE id=$id in your update. It's probably easiest to only let them update one at a time. Quote Link to comment Share on other sites More sharing options...
jwk811 Posted February 11, 2007 Author Share Posted February 11, 2007 lol sorry.. ill try to make it sound better.. i have a table on my db for products which includes name, price, etc... i have admin pages where i can set the price of each item.... in that page i need it to list all my products that i have saved into my db... to get the products on that page i do a mysql query to select everything in the table and then use while($row = mysql_fetch_assoc($result)){ extract $row; that way i now have the name and price of all my products and it will execute this code for all the products <input type="text" name="name" value="<?php echo $name; ?>"> and same for the price.. since it will show all these products like this they will all have the same name and that wont work when i try to update it to the db. i was wondering if it would be possible to use an array to make each unique and i need to know how to submit it to the db afterwords Quote Link to comment Share on other sites More sharing options...
jwk811 Posted February 11, 2007 Author Share Posted February 11, 2007 It's probably easiest to only let them update one at a time. your right thats probably the best way to do it, thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.