scrubbicus Posted December 7, 2009 Share Posted December 7, 2009 So I have this application that has some classes already setup for MySQL database entry, for INSERT and UPDATE $_POST information. All these pages that have this editable content have the same basic format with 1 item per row and then having many columns for all the information. For my settings page however I have certain settings grouped and each setting is a different ID with columns ID NAME and VALUE. Is there a way to get into one SQL statement, preferably an UPDATE SQL command, to UPDATE groups of IDs at the same time? Link to comment https://forums.phpfreaks.com/topic/184312-a-settings-page-how-do-i-set-this-up-easily/ Share on other sites More sharing options...
premiso Posted December 7, 2009 Share Posted December 7, 2009 You can use the IN() operator: UPDATE table_name SET col1 = somedata, col2 = somemoredata WHERE id IN(1, 2, 3, 4) Well only update col1 and col2 in the table where the ids are equal to 1 or 2 or 3 or 4 Link to comment https://forums.phpfreaks.com/topic/184312-a-settings-page-how-do-i-set-this-up-easily/#findComment-973064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.