It’s possibly due to the variable @count not being recognised as an integer but in my research I’ve come across many example similar to @count = @count + 1; That’s why I’m confused as to why this breaks my code when introduced:
$setCount = "SELECT @count:=5";
$uncategorise = "UPDATE pictures
SET category = '0',
pictureorder = @count,
@count:=@count+1
WHERE category = '$categoryID'
AND username = '$username';
$queryCount = mysql_query($setCount) or die(mysql_error());
$queryUncat = mysql_query($uncategorise) or die(mysql_error());
because this is an user defined variable,
which only stand/available for the same session/connection
There is an easy solution — php mysqli_multi_query