post here such a request:

$update="LOCK TABLES users_cash WRITE;"; $update.="UPDATE users_cash SET end='1' WHERE id='48';"; $update.="UPDATE users_cash SET end='1' WHERE id='45';"; $update.="UPDATE users_cash SET end='1' WHERE id='75';"; $update.="UPDATE users_cash SET end='1' WHERE id='77';"; $update.="UNLOCK TABLES;"; mysql_query($update); 

It produces the following error:

You have an error in your SQL syntax; If you’re on the right side, you’ll find out what you’re using for your users. SET end = '1' WHERE id = '48 '; UPDATE users_cash SET end =' 1 'WHERE' at line 1

What's my mistake?

  • maybe easier ... UPDATE users_cash SET end = '1' WHERE id in (48,45,75,77); - Yura Ivanov
  • well, even in the docks, by function, you can find a funny line about the use of ";" as a terminating operator (and not as part of a string) is forbidden - obviously, so as to prohibit injections in this way. - etki

2 answers 2

This extension is deprecated since PHP 5.5.0 and will be removed in the future. Use MySQLi or PDO_MySQL instead . See also the MySQL instruction : API selection and the corresponding FAQ for more details. Alternatives for this feature:

    I will give a tip - MySQL транзакции . In Google you will find the necessary examples of implementation.