CodeIgniter Forums

Full Version: Multiple Result set Issue in CI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
This is a bit different from what other users have faced in similar topics.

I have a stored procedure that I want to execute. I am trying to execute another query (that returns a count) after the procedure in CI, but CI returns the following error for not getting mysqli_result object.

Fatal error: Call to a member function num_rows() on a non-object

If the procedure execution is the last db statement in my code, everything works fine. But when I try to execute even a simple query after that, CI returns the error.

CI seems to freeze the resultset once a procedure is executed. I dont understand what prompted the CI developers to do that. I tried a simple workaround by calling the db connect() again and then, the new query starts working. But I guess that's not the right way to do it.

Did anyone else face this issue? If so, can you please guide me how to resolve this in an optimum way

El Forum

[eluser]danmontgomery[/eluser]
in ./application/config/database.php, check:

Code:
$db['default']['pconnect'] = TRUE;

El Forum

[eluser]adamp1[/eluser]
Do you have some example code of what does work and what dosn't?