Friday, March 13, 2015

how to create stored procedure for Select the single table values

I am working in php application. I want to get the events from my_events table. Simply i wrote the select query using stored procedure.

It's just easy to implement in my php application for application performace to increse.

DELIMITER $$

CREATE PROCEDURE `myporject_events`()

BEGIN
 SELECT * FROM my_events WHERE events_status="1" ORDER BY events_id DESC LIMIT 5;
END$$

DELIMITER ;

No comments:

Post a Comment