我试图执行以下查询:
$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);
在直播服务器上 :
- it works with MySql version 3.3.10.
- PHP version 5.2.17.
但我需要使用当地主机:
- XAMPP for linux, v. 1.7.7
- PHP 5.3.8
- MySql version 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数据库是否更容易?