$orderby = 'title';
$order = 'ASC';
$stmt = $conn->prepare('SELECT f.id, title, description, release_year, first_name, last_name FROM film AS f, film_actor AS fa JOIN actor AS a WHERE fa.actor_id = a.actor_id AND fa.film_id = f.film_id ORDER BY :orderby :order LIMIT :limit');
$stmt->execute(
array( 'order'=>$order,
'orderby'=>$orderby,
'limit'=>$limit
)
);
我試圖運行此查詢時遇到標題中描述的錯誤。我試圖找到一種方法來調試輸出,但失敗了。我會感激的幫助。 PS:我正在使用PHP中的PDO學習SQL。選擇語句PDO錯誤SQLSTATE [42000]:語法錯誤或訪問衝突:1064
在此先感謝。
感謝您的鏈接。 – bruhbruh 2013-05-13 07:19:03