我有一個包含許多有昏迷分離即其中的sprintf()子句
$emails = 「[email protected], [email protected], [email protected]」;
我有波紋管的PHP代碼,做工精細
<?php
function cust_get_oldest_items_all($limit = 1) {
$mSearch = new Search();
$result = $mSearch->dao->query(sprintf('SELECT pk_i_id FROM %st_item ORDER BY dt_pub_date LIMIT 0, %d', DB_TABLE_PREFIX, $limit));
return $result->result();
}
?>
我要電子郵件地址的字符串在上面的php代碼中使用WHERE子句只包含那些s_contact_email在$ emails中的項目?
使用'sprintf'編寫查詢具有**非常**的風險,不應該完成。這裏的「dao」是什麼?你可以用它來爲你做[轉義](http://bobby-tables.com/php)嗎? – tadman