limit-clause

MYSQL and the LIMIT clause

I was wondering if adding a LIMIT 1 to a query would speed up the processing? For example... I have a query that will most of the time return 1 result, but will occasionaly return 10's, 100's or even 1000's of records. But I will only ever want the first record. Would the limit 1 speed things up or make no difference? I know I could ...

passing LIMIT as parameters to MySQL sproc

I'm creating a paging class and need to pass in two parameters to my MySQL stored procedure for the LIMIT clause. I'm passing them in as INTs and trying something like this SELECT * FROM `MyTable` LIMIT MyFirstParamInt, MySecondParamInt it gives me an error when I try and save the sproc though. Is there a way to do this that I'm jus...