我正在pyrocms模块中进行自定义多重删除,如何在模型中使用delete 我的代码:
protected $_table = 'accounts';
public function mulDelete($muldelete)
{
$sql = 'delete from ' . $this->_table . ' where id IN('.$muldelete. ')';
$query = $this->db->query($sql);
}
但是$ this-> _table是返回帐户而不是 username_accounts,如何检查from子句中的用户名表前缀 pyrocms
答案 0 :(得分:0)
$sql = 'delete from ' .'username_'. $this->_table . ' where id IN('.$muldelete. ')';
或
protected $_table = 'username_accounts';
或动态
$CI =& get_instance();
$CI->load->database();
echo $CI->db->dbprefix;