Order by Domain Extension Name using CodeIgniter Active Record Class
Posted
by allan
on Stack Overflow
See other posts from Stack Overflow
or by allan
Published on 2010-04-14T06:31:19Z
Indexed on
2010/04/14
6:33 UTC
Read the original article
Hit count: 234
$extension = “SUBSTRING_INDEX(domain_name, ‘.’, -1)”;
$this->db->order_by($extension, “asc”);
It says: 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 ‘asc LIMIT 50’ at line 44
But its working when I didn’t used the $this->db->order_by Active Record Class such as this one: $this->db->query(“SELECT * FROM domain ORDER BY SUBSTRING_INDEX(domain_name, ‘.’, -1)”);
Anyone please help me. Thanks.
© Stack Overflow or respective owner