I have a big question about mysql_fetch_assoc in while. what happens is the following, I have a page where I do a database search and return for a while while the existing information with mysql_fetch_assoc, the problem is, when I want to do this while twice, it simply aborts, so I'm doing two you search the database on the same page, only changing one situation because of the first mysql_fetch_assoc that overrides the second and so on. the code acts is this.
$buscar_conteudotag = mysql_query('SELECT msg_message FROM flq_message WHERE msg_private LIKE 0 ORDER BY msg_id DESC') or die (mysql_error());
while($quantidade_de_tag = mysql_fetch_assoc($buscar_conteudotag)) {}
$buscar_conteudoclosest = mysql_query("SELECT msg_message FROM flq_message WHERE msg_private LIKE 0 AND msg_message LIKE '%".$closest."%' OR '%".$closest."%' ORDER BY msg_id DESC") or die (mysql_error());
while($buscar_conteudolinhaclosest = mysql_fetch_assoc($buscar_conteudoclosest)){}
$buscar_conteudotag = mysql_query("SELECT msg_message FROM flq_message WHERE msg_private LIKE 0 AND msg_message LIKE '%".trim(substr($siteuri, 1))."%' OR '%".trim(substr($siteuri, 1))."%' ORDER BY msg_id DESC") or die (mysql_error());
while($quantidade_de_tag = mysql_fetch_assoc($buscar_conteudotag)) {}
What I look for in case is a way to perform only one SELECT for all three whiles. Does it exist? if anyone can help me in this factor.