2016-05-25 51 views

回答

0

上了var $ postmeta的正確的sanitize和$後,你可以做建築DINAMIC查詢這樣 通過字符串concantenation(因爲var中的tabel和列名不允許在sql中)

$query="select * from " . $post . " INNER JOIN " . 
     $postmeta . " on " . $postmeta . ".post_id= " . $post .".ID where " . 
     $post . ".post_status='publish' and " . $post .".post_type ='task' and " . 
     $post . "post_type='service' ORDER BY " . $post .".post_date DESC "; 
相關問題