0

This is a MySQL PHP(5.2.5) setup.

I'm doing a basic call to a procedure like so...

$sp = mysql_query("CALL AlmGetRecord()"); 
$res = mysql_fetch_array($sp) or die(mysql_error());
print_r($res);

But no matter what i do, i get this error.

PROCEDURE AlmGetRecord can't return a result set in the given context

I did some quick googling around, didn't find much other than it being a potential Bug in PHP. Can anyone confirm that? or tell my why this error keeps popping up?

Thanks!

ipixel
  • 519
  • 8
  • 21
  • 3
    [Please, don't use `mysql_*` functions](http://stackoverflow.com/q/12859942/1190388) in new code. They are no longer maintained and are [officially deprecated](https://wiki.php.net/rfc/mysql_deprecation). See the red box? Learn about prepared statements instead, and use [tag:PDO] or [tag:MySQLi]. – hjpotter92 Apr 02 '13 at 14:53
  • Could you post the contents of your stored procedure? – ajtrichards Apr 02 '13 at 14:55
  • Please refer to this reply: http://stackoverflow.com/a/1201668 – hjpotter92 Apr 02 '13 at 14:55
  • The content of this particular one is a basic SELECT * FROM tablename; – ipixel Apr 02 '13 at 14:58
  • Thanks, i'll give the pdo/mysqli a shot. – ipixel Apr 02 '13 at 14:59
  • So my server does not have PDO installed for mysql. I spoke with the guy who has control over it, he said mysql_* works just fine. I had to add a few more parameters to the connection string. So now it's working. HOWEVER, i'm on your side with using PDO. I've been so used to using CMS queries, i never realized mysql_* function were deprecated. Thanks Guy! – ipixel Apr 02 '13 at 19:51

0 Answers0