I’ve got a script that pulls the ID from each row, and you can select from these to change multiple at the same time.
I have an array of the ID’s to update, but how do I select a group of arbitrary ID’s in a single mysql query?
Something like:
SELECT * FROM 'locations' WHERE 'region'='$region' AND 'uniqueID'={$id_array}
I’m a bit confused on this, i’m sure mysql has a special operator for this sort of thing. Or does it? Would I be better off just doing a separate mysql query for each element? (If so, can I tie multiple queries in to a single PHP mysql call?… to reduce connections)
SELECT * FROM 'localtions' WHERE 'uniqueID' IN (.....your ids here, comma separated)For a PHP solution:
WHERE uniqueid IN (" . implode($id_list, ",") . ")