PDO: Calling mysql stored procedure that creates a temporary table and then selecting from it
This is a simplified version of my query:
CALL Create_List( 'company' ); SELECT name FROM tmpCompany;
Create_List creates a temporary table tmpCompany.
These two statements work correctly when run directly into the database using phpmyadmin but when i call it using PDO in php, I don't get a result.
Is there a specific way of calling stored procedures from php?
PHP Code
$result = $this->db->prepare( "CALL Create_List( :table ); SELECT name FROM tmpCompany;" );
$result->bindParam( ':table', $this->table );
$resu开发者_运维知识库lt->execute();
return $result->fetch();
EDIT
Possibly related?
http://bugs.php.net/bug.php?id=38001
Try breaking the CALL and SELECT into separate statements.
精彩评论