04-04-2010, 09:03 AM
[eluser]oppenheimer[/eluser]
Active record join doesn't work when a table name includes a dash "-". For example:
Produces the following error:
Notices the ON clause is unusually quoted. The active record class works well on those tables in all other respects.
Any ideas?
Active record join doesn't work when a table name includes a dash "-". For example:
Code:
$this->db->select('*');
$this->db->from('12-registration');
$this->db->join('12-students', '12-students.studentid = 12-registration.studentid');
$query = $this->db->get();
return ($query->row_array());
Produces the following error:
Code:
A Database Error Occurred
Error Number: 1054
Unknown column '12' in 'on clause'
SELECT * FROM (`12-registration`) JOIN `12-students` ON `12`-`students`.`studentid` = 12-registration.studentid
Notices the ON clause is unusually quoted. The active record class works well on those tables in all other respects.
Any ideas?