Hello,
I'm just new here, I'm having a problem dealing with integration of PHP and MySQL Stored Procedures. The problem is:
Here's the Stored Procedure:
DELIMITER $$;
DROP PROCEDURE IF EXISTS test.sampleSP$$
CREATE DEFINER=root@localhost PROCEDURE sampleSP()
BEGIN
select * from test;
END$$
DELIMITER ;$$
Here's the PHP code:
$query = "call sampleSP()";
$result = mysql_query($query);
echo mysql_num_rows($result);
Whenever I preview the php page I get this problem:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\htdocs\Untitled-1.php on line 8
I don't know where the problem arises, please help me on this one.
Thanks a lot! 🙂