<https://cmstools.ru/topic/427-%D1%85%D0%B0%D0%BA%D0%BF%D0%BE%D0%BF%D0%BE%D0%BB%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5-%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B0-%D1%81-%D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D1%8C%D1%8E-%D0%B0%D0%BA%D1%82%D0%B8%D0%B2%D0%B0%D1%86%D0%B8%D0%B8-%D0%BA%D0%BE%D0%B4%D0%B0/#comment-3676>
<http://schema.org/text>
"Правильнее так: \n\n\t\tcase \"code\":\n\t\tNoAjaxQuery();\n\t\t\t$code=$_POST['code'];\t\t\t\n\t\t\t$row = $db-&gt;super_query(\"SELECT * FROM `\".PREFIX.\"_codes` WHERE code = '{$code}' LIMIT 1\");\n\t\t\tif($row){\n\t\t\t\tif($row['activate'] == 0 AND $row['user_id'] == 0){\n\t\t\t\t\t$db-&gt;super_query(\"UPDATE `\".PREFIX.\"_users` SET user_balance=user_balance+'{$row['fbm']}', balance_rub=balance_rub+'{$row['rub']}', user_rating=user_rating+'{$row['rating']}' WHERE user_id='{$user_id}'\");\n\t\t\t\t\t$db-&gt;super_query(\"UPDATE `\".PREFIX.\"_codes` SET activate = 1, user_id ='{$user_id}' WHERE code='{$code}'\");\n\t\t\t\t\techo 'ok';\n\t\t\t\t} else echo '2';\n\t\t\t\t\t\n\t\t\t} else echo '1';\t\n\n        exit();\t\t\t\n\t\t\t\t\t\t\n\t\tbreak;\n\nЗачем делать 2 запроса? достаточно 1 \n"
<https://cmstools.ru/topic/427-%D1%85%D0%B0%D0%BA%D0%BF%D0%BE%D0%BF%D0%BE%D0%BB%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5-%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B0-%D1%81-%D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D1%8C%D1%8E-%D0%B0%D0%BA%D1%82%D0%B8%D0%B2%D0%B0%D1%86%D0%B8%D0%B8-%D0%BA%D0%BE%D0%B4%D0%B0/>