I want to get the out parameter of stored procedure using Zend framework
Here’s the procedure
DELIMITER //
CREATE procedure getAllUsers( out sysUsers VarChar(50) )
BEGIN
DECLARE usersCursor CURSOR FOR SELECT username FROM SYSTEM_USERS;
OPEN usersCursor ;
FETCH usersCursor INTO sysUsers ;
CLOSE usersCursor ;
END//
DELIMITER ;
And here what I don through Zend framework
try {
$db = Zend_Db_Table::getDefaultAdapter();
$stmt = $db->query("CALL getAllUsers(@users)");
//Returns an array containing all of the result set rows
$rows = $stmt->fetchAll();
$stmt->closeCursor();
print_r($rows);
} catch (Exception $e) {
echo 'error ' . $e;
}
an empty array returns!! how can I return a recursor form stored procedure.
I solve the problem without using the cursor I make like this