Distant_storm Posted December 13, 2007 Share Posted December 13, 2007 I have never been that good at making sql statments i only know a limited amount of query language. I have a database table which i need to update several items via their ID. so I have a set off image which can be any amount with checkboxes... if the image is checked then that image in the database table should be updated. it would look like "SELECT * FROM the_photo_album WHERE id={$_POST['checked_image']}"; now instead of putting it OR this or that would it be best to loop through each one updating each one everytime it loops ? hmm any help would be apreciated, also if anyone has any links to good querys e.t.c that be good Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 13, 2007 Share Posted December 13, 2007 What? Quote Link to comment Share on other sites More sharing options...
Distant_storm Posted December 13, 2007 Author Share Posted December 13, 2007 ok a form sends back X amount of ID's which corrispond to fields in a table which identifies records eg ID Data 1 a 2 b 3 c 4 d Now say the form sends the id's 1 3 and 4 I want the script to change the data of 1 3 and 4 to the word Blah how would i do this using an update query such as "UPDATE table_name SET data='blah' WHERE ID='$id'"; ok thats the type of thing i want to do, but as their could be any amount of Id's so how would i go about it Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 13, 2007 Share Posted December 13, 2007 You would have to keep updating each field seperatly. 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.