1

i have been trying to use mysql_fetch_assoc to the results that obtain through my stored proceedure.. but i keep on getting the error

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in 

I checked all similar questions in this site related to this. but none could sought out this issue

$excute = mysql_query("CALL Dummy_2('table_1')");
$result = mysql_fetch_assoc($excute);
var_dump($result);

returns an error

$excute = mysql_query("SELECT * FROM table_1");
$result = mysql_fetch_assoc($excute);
var_dump($result);

works fine

error returns only with the stored procedure, normal query works fine

in case the stored procedure

BEGIN   

SET @sqlstring = CONCAT("
SELECT  DISTINCT b.ID, name, accountname, c.accountID, status, total_impr, min(a.timestamp), max(a.timestamp)
FROM    ",table_1," a INNER JOIN bookers b on a.ID = b.ID INNER JOIN accounts c on b.accountID = c.accountID

WHERE   a.timestamp > DATE_ADD(NOW(), INTERVAL -3 YEAR)
GROUP BY ID;");
    PREPARE stmt FROM @sqlstring;
    EXECUTE stmt;

END$$
Prog_Rookie
  • 438
  • 7
  • 23

0 Answers0