ORDER BY QUERY BUILDER ISSUE |
I hava a test query :
Code: $this->db->where('1 IS NOT NULL',NULL,FALSE)->WHERE('X>','0')->FROM('X')->ORDER_BY('X','ASC')->count_all_results(); and it is generating error: Code: Error Number: 42000/1033
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes
![]() If i write something by mistake; please don't distress it and try to understand what i want to write.
Why are you doing ORDER BY clause if you just need to get the number of records?! Just remove it.
The error is coming from SQL Server, not from Query Builder. As siburny said, you need to take out the order_by clause in your query. In most cases, Query Builder isn't going to check whether the particular combination of SQL commands you've specified is permitted by your platform; it will let the database server produce an error, as it has in this case.
https://github.com/bcit-ci/CodeIgniter/issues/4395
It'd be much less time-wasting for everybody if people didn't cross-post. |
Welcome Guest, Not a member yet? Register Sign In |