Topic: Calling a new MySQL query stops a current one?
I'm currently trying to add a little mod to my forums, but ran into an error.
If I run a new $db->query( 'blah' ); while there is another one currently going on, it stops the old one completely.
I tried searching but didn't find anything, mainly because I'm not sure how to describe this situation.
The function I'm using is this, I just echo it in viewtopic.php
function showRatings( $cur_post )
{
global $db, $pun_user;
if ( $pun_user['id'] != $cur_post['poster_id'] )
{
$rhtml = '<div class="rate_it"><div class="rate_bar" style="width: 140px;" id="rb_'.$cur_post['id'].'">';
$rhtml .= '<div class="rate_text" style="width: 140px;" id="rbt_'.$cur_post['id'].'"> </div>';
$rtres = $db->query( 'SELECT name, image FROM '.$db->prefix.'ratings' );
while( $rtrow=mysql_fetch_assoc( $rtres ) )
{
$rhtml .= '<div class="rate_button" onmouseover="rateHover(true,\''.$cur_post["id"].'\',\''.$rtrow["name"].'\');" onmouseout="rateHover(false,\''.$cur_post["id"].'\',\'\');"><img src=\''.$rtrow["image"].'\'></div>';
}
$rhtml .= '</div></div>';
}
return $rhtml;
}
And example is if the function is run, the only post you see is the first post you can rate, otherwise you can see all the posts.