Hi,
How do i check result of out parametter of stored procedure in php?
CREATE PROCEDURE `username`(IN name_in varchar(10), OUT name_out varchar(10))
BEGIN
SELECT name FROM table WHERE name= name_in;
END;
//This always returns 1 even there is no record in the table.
$query = "CALL username($name, @out)";
$run = mysql_query("SELECT @out");
if (@mysql_num_rows($run) ==0) {
echo "No record";
} else {
echo "Yes record";
}
Where is the mistake?
Thanks guys