this is my sp:
CREATE DEFINER=`root`@`localhost` PROCEDURE `getproductname`(in productid int , out productname varchar(200))
BEGIN
select product_name from product where product_id=productid ;
END
and this is my php code:
$mysqli = new mysqli(DB_HOST,DB_USER,DB_PWD,DB_NAME);
$mysqli->query("CALL getproductname(2049,@productname)") ;
$result = $mysqli->query("SELECT @productname");
while($row = $result->fetch_object()){
echo ($row[0]);
}
and this is error:
Fatal error: Call to a member function fetch_object() on a non-object in D:\WEB\book24ss\_res\sptest.php on line 19
why?