PHP with MySQLi help!
Posted: Tue Aug 10, 2010 11:40 pm
So, I'm having a problem with MySQLi, more specifically:
Essentially, I have some queries that have a pseudocode like:
I'm pretty sure it's because i have a query while another query is still there (and not all fetched). Is there anyway that I could fix this?
<3
Thankies
Code: Select all
Warning: mysqli::prepare() [mysqli.prepare]: All data must be fetched before a new statement prepare takes place in E:\xampp\nothing\inc\classes.php on line 489
Code: Select all
if ( $st = $mysqli->prepare( "SELECT ...") )
{
$st->bind_param( ... );
$st->execute();
$st->bind_result( $result );
while( $st->fetch() )
{
$p = new Post( $result );
$p->display();
}
$st->close();
}
// Then display looks something like:
var $result;
function display()
{
echo "The result is: " . $this->result;
// The error is coming from this line:
if ( $st = $mysqli->prepare( ... ) )
{
$st->bind_param( ... );
$st->execute();
$st->bind_result( ... );
echo "something";
$st->close();
}
}
<3
Thankies