I have the following Active Record pattern within one of my models :
$this->db->get('names');
$this->db->like('name', $name);
$this->db->where('ratio >=', 0.75);
$this->db->order_by('ratio', 'desc');
$query = $this->db->get();
This gives me a syntax error :
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `ratio` >= 0.75 AND `name` LIKE '%JORDAN%' ORDER BY `ratio' at line 2
The full statement being returned is :
SELECT * WHERE `ratio` >= 0.75 AND `name` LIKE '%JORDAN%' ORDER BY `ratio` desc
I don't know why my table names
isn't showing as I'm calling $this->db->get('names');
which should produce SELECT * FROM names
, is it just not returning in the error? What's wrong with this statement and what should I do to correct my Active Record call?