Hi I am developing a bulk update script, which is below
function db_update($table){
$mysqli = db_connect();
$query = "UPDATE $table SET ";
foreach($_POST as $aKey=>$aValue){
while($aValue){
$query = $query . " `value` = '$aValue' WHERE `tag`='$aKey'";
$mysqli->query($query) or die("My SQL didn't work in update query." . mysql_error() . $query. '<br><hr>');
}
}
}It works by retrieving the name of each POST (eg 'date') and then inserts it into the coulmn 'value' where tag = date
now the problem is the above is not working properly, it is not making one query per $_POST and I need it to do that for it to work as you cant have multiple WHERE clauses for the one query
Any help is greatly appreciated