gnawz Posted April 22, 2009 Share Posted April 22, 2009 Dear PHP freaks, I have a small problem. I need help oh how I can be able to update more than on record and save it all in one click. I need to read data from a database, say of 200 different items. I would like to edit the price of each item but I do not want it done 1 by one. I want to be able to display all items or a fragment of them (paginated. say 20 par page) each with its price in an text box, edit the price, then click save and all the item prices I have edited are saved. Same way phpmyadmin can allow one to check fields to edit, then open them in an editable display, edit them and click save or the way one can edit comments of photos in social networking utilities, then save all in one button click. I will appreciate any help Quote Link to comment Share on other sites More sharing options...
tang Posted April 22, 2009 Share Posted April 22, 2009 You probably need some sort of data grid script. Search for php data grid or similar, find one, set it up and post if you have problems. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 22, 2009 Share Posted April 22, 2009 http://www.phpfreaks.com/forums/index.php/topic,248800.msg1165220.html#msg1165220 Quote Link to comment Share on other sites More sharing options...
Gighalen Posted April 22, 2009 Share Posted April 22, 2009 while($i >= $num_rows) Quote Link to comment Share on other sites More sharing options...
gnawz Posted April 23, 2009 Author Share Posted April 23, 2009 This looks interesting while($i >= $num_rows) please continue Quote Link to comment Share on other sites More sharing options...
Gighalen Posted April 23, 2009 Share Posted April 23, 2009 Count the number of rows your updating, sort the data into an array, and then run a while function doing the same query only updating the entry in the database based on the values in the array. Does that make sense? I'm not the greatest when it comes to explaining stuff. Quote Link to comment Share on other sites More sharing options...
gnawz Posted April 23, 2009 Author Share Posted April 23, 2009 I'm not certain it does quite well but i understand a bit. Sorting into an array and the SQL I will write will give me some issues I guess. 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.