date | layout | slug | title | tags | location | geo | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2008-01-12 00:58:47 UTC |
post |
173 |
MySQL Stored Procedure in PHP gotcha |
|
Carr Street, Toronto, ON, Canada |
|
If you're getting a 'Commands out of sync' message after calling a Stored Procedure in MySQL 5+, it means there's some empty resultset in still in the resultset buffer. I'm not sure exactly why this is happening, but here's the workaround:
<?php
// Assuming $connection is your MySQLI object
while($connection->next_result()) $connection->store_result();
?>