PDA

View Full Version : Updating multiple database elements...


tomyknoker
02-21-2008, 05:32 AM
I want to do a multiple update of some people in my database, just want to make sure I have the right SQL statement before I go ahead and kill something :) I'm assuming I need an OR in there, so it'd look like this...


UPDATE people SET suburb='maryweather' WHERE
ID=2562
OR ID=384
OR ID=857
OR ID=3242

_Aerospace_Eng_
02-21-2008, 05:37 AM
Backup your database, then run the query and see if it works. If it doesn't restore your database. Simple.

tomyknoker
02-21-2008, 06:20 AM
Yea I thought about just trying it but if those rows didn't turn out the way they were meant to just would have been a massive pain to restore... Anyway I ran a SELECT along the same lines and seemed to select the ones I wanted so guess it'll work :) Not sure wether this needs a new post but it's part of this so here we go, I'm using phpMyAdmin to edit the db and whenever I edit more than 10 rows at a time the page won't load... Is that just a dodgy server thing?

_Aerospace_Eng_
02-21-2008, 06:30 AM
Possibly or the install of phpmyadmin got corrupted some how. I've edited more than 10 rows using phpmyadmin on a few of the servers I run and its fine.

tomyknoker
02-21-2008, 07:09 AM
Yea just won't work, how else can edit the db? Is SSH the only other way?