Hi all,
After a long time i am back with a new problem. Right now I am having a problem with stored procedure.
I am using stored procedure with PHP/MYSQL. And evry time I am changing the condition of query in stored procedure. when I am passing numeric value then its working fine but when I am passing varchar or text in parameter then it ia not working. While I have declare variable as VARCHAR(255).
Here is SP query...
Please help me out.
Thanks in advance
After a long time i am back with a new problem. Right now I am having a problem with stored procedure.
I am using stored procedure with PHP/MYSQL. And evry time I am changing the condition of query in stored procedure. when I am passing numeric value then its working fine but when I am passing varchar or text in parameter then it ia not working. While I have declare variable as VARCHAR(255).
Here is SP query...
Code:
CREATE PROCEDURE `testproc4`(IN `loc_name` VARCHAR(255), IN `property_country1` INT, IN `begin_beach_id` INT, IN `beach_id` INT, IN `lpi` INT, IN `lti` INT, OUT `prop_count` INT) LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA SQL SECURITY INVOKER COMMENT '' BEGIN IF property_country1 = "" THEN SELECT COUNT(pl.`property_id`) AS property_id INTO prop_count FROM `tbl_belt_propertylocation` AS pl JOIN `tbl_belt_propertydescription` AS pd ON (pl.property_id=pd.property_id) JOIN `tbl_belt_propertyfeatures` AS pf ON (pl.property_id=pf.property_id) WHERE `property_isdeleted` = 0 AND `property_beachdistance` > begin_beach_id AND `property_beachdistance`<= beach_id AND property_isdeleted=0 AND property_active=1; ELSE SELECT COUNT(pl.`property_id`) AS property_id INTO prop_count FROM `tbl_belt_propertylocation` AS pl JOIN `tbl_belt_propertydescription` AS pd ON (pl.property_id=pd.property_id) JOIN `tbl_belt_propertyfeatures` AS pf ON (pl.property_id=pf.property_id) JOIN `tbl_belt_location` AS country ON pl.property_country=country.id WHERE loc_name = property_country1 AND `property_beachdistance` > begin_beach_id AND `property_beachdistance`<= beach_id AND country.location_parent_id = lpi AND country.location_type_id = lti AND property_isdeleted=0 AND property_active=1; END IF; END
Thanks in advance