Page 1 of 1

PROCEDURE Problem

Posted: Tue Apr 08, 2008 11:04 am
by itsmani1
I am having problem with limit variable in PROCEDURE:
If i try following code i get error, in this code I am passing lmting variable as start limit of the results and its giving me error. If i don't pass the variable it works fine without any problem.

Here is my current procedure:

Code: Select all

CREATE PROCEDURE `zselectClassifieds`(IN catid INTEGER(11), IN lmting INTEGER(11))
select zclassifieds.price,zclassifieds.title, zclassifieds.PK_ID, date_format(zclassifieds.created, '%d-%b') as created,
     user.login_id, zclassifieds.location
     from 
     zclassifieds, user 
     where 
     zclassifieds.FK_ZCATEGORY_ID = catid and 
     user.PK_ID = zclassifieds.FK_USER_ID and 
     zclassifieds.expiry > now()    
     order by zclassifieds.PK_ID desc
     LIMIT lmting , 30 ;