I have this function:
function updateinfos($id) {
parametrs();
$Log_query = mysql_query("SELECT max(recent) FROM song") or die(mysql_error());
$Res_user = mysql_fetch_array($Log_query);
$max = $Res_user[0] + 1;
$Log_query2 = mysql_query("UPDATE song SET recent = '$max' AND number = number + 1 WHERE id = '$id'") or die(mysql_error());
}
I have a problem in the query update, because it doesn’t work and I don’t know why.
You have the syntax for UPDATE wrong.
By using AND, you’re making a boolean expression, not setting the value for two columns.
You should write an UPDATE statement that changes multiple columns like this:
In other words, use a comma, not AND.