PROCEDURE Problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

PROCEDURE Problem

Post 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 ;
Post Reply