0
我無法根據包含數字的列「order」來獲取我的sql以拉取照片。以下工作正常,但它似乎是基於「cms_uploads」中的「num」列拉動照片。在SQL查詢中定義ORDER
$photoSql = "SELECT * FROM cms_uploads WHERE ('tableName'='residential_master_rental_availabilities' AND 'recordNum' = '".$rent['num']."' AND 'fieldname' = 'image') LIMIT 1";
該查詢返回什麼:
$photoSql = "SELECT * FROM cms_uploads WHERE ('tableName'='residential_master_rental_availabilities' AND 'recordNum' = '".$rent['num']."' AND 'fieldname' = 'image') ORDER BY 'order' LIMIT 1";
刪除列名中的引號 –
(除了在保留字上需要bacticks) – Strawberry