saseow
Posts: 744
|
| Posted: 01/02/2009, 7:38 AM |
|
I am using Mysql and creating a grid which I want to limit the results to 30. I know the query works as I have tried it against the database but.....
When I use it in CCS I get:
Database 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 'LIMIT 0,31' at line 3.
The query is:
SELECT * FROM products LEFT JOIN categories_link ON
products.ID = categories_link.products_id
ORDER BY products.ID desc LIMIT 0,30;
I have no idea what is wrong. Has anyone had this problem before?
I resolved this by creating a new connection and ticking OFF the Limit/Top box. It seems that CCS adds limits by itself if this box is checked.
|
 |
 |
datadoit
|
| Posted: 01/02/2009, 7:43 AM |
|
Your database connection probably already has the LIMIT property set, so
the query is really:
SELECT * FROM products LEFT JOIN categories_link ON
products.ID = categories_link.products_id
ORDER BY products.ID desc LIMIT 0,30 LIMIT 0,31;
|
|
|
 |
saseow
Posts: 744
|
| Posted: 01/02/2009, 7:46 AM |
|
Hi dataoit, you are dead right. See my change above. Thanks for the input.
|
 |
 |
|