DB Selection error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: DB Selection error (/showthread.php?tid=38393) |
DB Selection error - El Forum - 02-07-2011 [eluser]Unknown[/eluser] Hi Is it wrong to write this query in codeigniter in this way ? if yes how shall I do it ? by the way the query is right i test it in phpmyadmin Code: $query = $this->db->query("SELECT 'products'.'ID', 'products'.'title', 'products'.'cID', 'p_pic'.'image', 'categories'.'title' Quote:A Database Error Occurred DB Selection error - El Forum - 02-11-2011 [eluser]abedzilla[/eluser] Try to remove the single quotes, CI usually rewrite the sql with safer query. Or try to replace the single quotes with mysql quote (`) <-- the quote under the escape button |