mysql_query("UPDATE users SET id =`id`+ 2 + ROUND(RAND() * 3) where username = '".$_SESSION['username']."'"); How to calculate which numbers to replace with id, please drop the calculation algorithm, thanks in advance.
mysql_query("UPDATE users SET id =`id`+ 2 + ROUND(RAND() * 3) where username = '".$_SESSION['username']."'"); How to calculate which numbers to replace with id, please drop the calculation algorithm, thanks in advance.
$id = $id + 2 + rand(0,3); It looks like two queries:
SELECT id FROM `users` WHERE username = '{$_SESSION["username"]}' FOR UPDATE // вытаскиваем $id // что-то делаем с id типа: // $id += 2 + rand(0,3); UPDATE `users` SET id = {$id} WHERE username = '{$_SESSION["username"]}' Then, from the time select to update, the line is loaded
Can not calculate.
Source: https://ru.stackoverflow.com/questions/65079/
All Articles