I have an admin script that needs to update multiple rows at one time. In the past, I have written it like so:
$updateArray = array("one", "two", "three", "four");
foreach($updateArray as $id=>$value)
{
$SQL = "UPDATE table SET field='$value' WHERE id='$id'";
mysql_query($SQL);
}
Now, my question is, is there a way to construct an SQL statement so that I don't have to loop through and query the database multiple times? I realize that this is more of an SQL question than it is a PHP question but this board is one of the only places I know of where I can get results quickly.
Any insight would be appreciated.