我正在尝试执行以下查询:
$query = "SELECT O. * AS NUM FROM (ab_order O)
LEFT JOIN ab_user U ON (O.id_user=U.id)
WHERE O.id IN ( SELECT OT.id_ab_order FROM ab_order_transaction OT
LEFT JOIN ab_transaction T ON (OT.id_ab_transaction = T.id)
LEFT JOIN ab_user U ON (T.id_user = U.id)
WHERE T.validated = 1 {$condTrans} ) {$condOrder}
ORDER BY {$orderCol} LIMIT $from, $numRecords ";
$queryDB = $DB->queryExec($query);
在实时服务器上:
- 它适用于 MySql 版本 3.3.10。
- PHP 版本 5.2.17。
但我需要使用本地主机:
- XAMPP for linux, v. 1.7.7
- PHP 5.3.8
- MySql 版本 5.5.16。
在本地主机上它说:
MySQL error: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS NUM
FROM (ab_order O)
LEFT JOIN ab_u' at line 1.
有没有更简单的方法然后升级实时服务器 Mysql 数据库?