0
如何在插入行後對錶進行排序?Mysql PHP - 插入行後排序表
我嘗試下面的代碼,但我得到一個錯誤:
$sql = "INSERT INTO vendors (vendor, pavcode, pavname) VALUES (?, ?, ?) ORDER
BY vendor ASC";
感謝您的幫助。
編輯:我得到一個語法錯誤如下:
ERROR: Could not prepare query: INSERT INTO vendors (vendor, pavcode, pavname) VALUES (?, ?, ?) ORDER BY (vendor) ASC. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY (vendor) ASC' at line 1
https://dev.mysql.com/doc/refman/5.7/zh/order-by-optimization.html –