I want to check if a table in the OpenCart database exist so i made this function
public function CheckCustomer(){
$query = $this->db->query('SELECT * FROM '.DB_PREFIX.'customer_online');
return $query->row;
}
and in my controller i test if it exists i set a variable to 1 or 0 depending.
The table does exist everything is fine, byt if i delete the c from customer just to simulate the table not being there my tpl page is not rendered instead i get this error :
Notice: Error: Table 'OpenCart-Test.oc_ustomer_online' doesn't exist Error No: 1146 SELECT * FROM oc_ustomer_online in /home/justine/www/opencart-test/opencart-1.5.5.1/upload/system/database/mysql.php on line 50
Is there anyway of doing this without it throwing errors on screen as i need to know if the table exists before i display certain information in my tpl file.
Hope someone can shed some light on this.