我可以在PHPMyAdmin中运行以下查询,但由于某些原因,我在PHP中的mysql方法中运行它时出现语法错误:Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server'SET @lastid = LAST_INSERT_ID(); INSERT INTO product_desc
SELECT @row_num := @row_num + 1 as row_number,id,name,salary ORDER BY salary;
您的SQL语法有错误;检查与您的MySQL服务器版本对应的手册,以获得使用near‘的正确语法;在第1行选择@row_num := @row_num