I having a problem with the mysqli free() member function

Posted by neo skosana on Stack Overflow See other posts from Stack Overflow or by neo skosana
Published on 2010-05-09T11:26:11Z Indexed on 2010/05/09 11:38 UTC
Read the original article Hit count: 123

Filed under:
|
|

Hi

I have code where I connected to the database like so:

$db = new mysqli("localhost", "user", "pass", "company");

Now when I query the database like so:

//query calls to a stored procedure 'user_info' 
$result = $db->query("CALL user_info('$instruc', 'c_register', '$eml', '$pass', '')");
//I use the $result

This query works well. Now when I try and free that result like so:

$result->free(); 

or

$result->close();

It seems like it doesn't do anything because $result is still set. When I try to run another query it gives me this error: Fatal error: Call to a member function fetch_array() on a non-object in... For me to run this other query I have to close the db conection and connect again, then it will work. I want to know if there is a way I could run the other query without having to disconnect and reconnect to the database.

thanks in advance.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysqli