2016-05-25 24 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 "; 
相关问题