Stored Procedure error
Posted: Sun Sep 11, 2011 9:47 am
Hi
I create a stored procedure in mysql to show all the data from "biografie" table:
In PHP a write the following code:
And it show the following error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/picturi/public_html/test.php on line 23
Can you please tell where it's the error ?
I create a stored procedure in mysql to show all the data from "biografie" table:
Code: Select all
DELIMITER //
CREATE PROCEDURE biografie()
BEGIN
SELECT * FROM biografie;
END //
DELIMITER ;
Code: Select all
<?
$conexiune=mysql_connect($host,$user,$pass) or die ("conexiunea nu a fost stabilita");
mysql_select_db ($db,$conexiune) or die ("nu sa conectat la baza de date");
$q = mysql_query("CALL biografie()");
while($qw = mysql_fetch_assoc($q))
{
echo $qw['id'].'<br>';
}
?>
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/picturi/public_html/test.php on line 23
Can you please tell where it's the error ?