Dreamweaver/MySQL/MyODBC sql LIMIT error

This is killing me, and I imagine it is something simple.

I am working with Dreamweaver, a hosted MySql db, and connecting through MyODBC on my local machine.  With the MySQL Control Center 0.8.10-beta, I have no issue testing the following sql statement, and it returns exactly as it should.

FROM `month_bill_info`
order by bill_id desc
limit 0,1

Simple enough, right?

Well, when I am creating a recordset in Dreamweaver, use the Advanced option, and enter in the exact same SQL, it just doesn't seem to want to go through.  Does this error message mean anything to anyone?

"[TCX][MyODBC] You have an error in your SQL syntax near 'limit 100' line 4"

Since it works with the MySQL interface, I would point to Dreamweaver/MyODBC, but this seems like a pretty simple query that wouldn't cause a problem.  Any option I didn't check eith MyODBC or dreamweaver quirk?

I can actually just force the sql into the recordset anyway, upload the files to the host, and it will work on the site, but it does bother me about not working locally.

Any help would be apprecaited...  Thanks.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

first of all, you simply CAN NOT have "error near 'limit 100'" if you use a query with "limit 0,1" ;-))))))))))

so first check that the query is really the one you want.
Then I would recommend not to use "limit 0,1" but "limit 1"

Lastly, you are NOT using "mySql interface" by using mySql control center (what's that?!?). You should use the MySql CONSOLE (execute "mysql --user=root --password=yourpassword" at the "DOS" level) to test your queries before putting them in yuor scripts.

Good luck.
keeper3Author Commented:
MySQL Control Center is a just a GUI for managing MySQL db's and data for those of us who prefer such a thing...


Odd thing is, the "limit 100" doesn't seem to be referring to the "limit" statement I am typing, at least not directly.  

If I enter the following erroneous sql...

FROM `month_bill_info`
ORDER BY bill_id desc
limpt 0,1

where I throw in a "p" instead of the 2nd "i" in "limit", I get the following error message:

"[TCX][MyODBC] You have an error in your SQL syntax near 'limpt 0,1 limit 100' line 4"

So basically the same message, but with my incorrect sql statement appended.

As for trying "limit 1", it gives me the same error message.
THEN the cause of the error is EVIDENT : you GUI tool add itself a "limit 100" to your query !!! (to limit the results and compute time probably)

so ***of course*** you CAN'T specify a limit yourself, because "SELECT ... LIMIT 0,1 LIMIT 100;" is obviously wrong.

Hence the error.

Drop that GUI to the trash and use a real "clean" tool that doesn't add itself things to your queries :D
demonstration :

mysql> select * from activite limit 0,1;
| id     | ip          | pseudo   | action                                                                       | heure               | niveau |
| 349272 | | visiteur | UA = Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Crazy Browser 1.0.5) | 2003-02-27 12:48:33 |      4 |
1 row in set (0.01 sec)

mysql> select * from activite limit 0,1 limit 100;
ERROR 1064: You have an error in your SQL syntax near 'limit 100' at line 1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
keeper3Author Commented:
Got it, makes sense.  Problem is the GUI trash is Dreamweaver, which I say is quite a helpful web development tool.  I'll see if I can find an option somewhere in it on limiting rows.  Appreciate it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.