DELIMITER $$
CREATE PROCEDURE get_employee()
BEGIN
SELECT *
FROM employee;
END $$
above query will create stored procedure through you phpmyadmin.you can see the created stored procedure inside the Routines tab.
in php code use the below code to access the Store procedure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php $linkfirst = mysql_connect('localhost', 'root', ''); if (!$linkfirst) { die('Could not connect: ' . mysql_error()); } mysql_select_db('hello', $linkfirst) or die('Could not select database.'); $rs = mysql_query('CALL get_employee()'); while($row = mysql_fetch_assoc($rs)) { echo $row['Name']; echo "<br>"; } ?> |