php - Table prefix in pyrocms -
i working on custom multiple delete in pyrocms module,how use delete in model code:
protected $_table = 'accounts'; public function muldelete($muldelete) { $sql = 'delete ' . $this->_table . ' id in('.$muldelete. ')'; $query = $this->db->query($sql); } but $this->_table returning accounts instead of username_accounts,how check username table prefix in clause in pyrocms
$sql = 'delete ' .'username_'. $this->_table . ' id in('.$muldelete. ')'; or
protected $_table = 'username_accounts'; or dyamically
$ci =& get_instance(); $ci->load->database(); echo $ci->db->dbprefix;
Comments
Post a Comment