PROCEDURE can't return a result set in the giv
Posted: Thu Oct 21, 2010 8:39 am
Hello,
I'm new to PHP and MYSQL.
Have just set up XAMPP for windows and have written a basic web page to connect to MYSQL and run a stored procedure but i keep getting this error "PROCEDURE htc.get_bands can't return a result set in the given context".
The procedure is a simple SELECT * statement. If i actually write the statement into the php code it works. But when i CALL the stored procedure to do the same thing i get the error.
I've had a look on google but theres alot of posts on this and some seem to be bugs but i'm using PHP 5.3.1 and latest version on XAMPP.
Any ideas?
I'm new to PHP and MYSQL.
Have just set up XAMPP for windows and have written a basic web page to connect to MYSQL and run a stored procedure but i keep getting this error "PROCEDURE htc.get_bands can't return a result set in the given context".
The procedure is a simple SELECT * statement. If i actually write the statement into the php code it works. But when i CALL the stored procedure to do the same thing i get the error.
I've had a look on google but theres alot of posts on this and some seem to be bugs but i'm using PHP 5.3.1 and latest version on XAMPP.
Any ideas?
Code: Select all
<?php
include("connect.php");
$query = "CALL get_bands;";
$result = mysql_query($query) or die("Query failed with error: ".mysql_error());
while($row = mysql_fetch_array($result))
{
echo $row['BandRef'] . " " . $row['BandName];
echo "<br />";
}
mysql_close($con);
?>