PHP and Mysql Queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

I have a script that runs a mysql query against my database. I need to loop through the array of data twice. My script runs the first loop as expected but when it runs the second loop I get no data returned. Is there a way to be able to loop through the same data result set twice without having to take the data set and put it into a different array variable. Any ideas are greatly appreciated.

Thanks,
Jason

Code Block

$q_navmenu = "select navmenu,count(navmenu) as count from sitenav where navgroup = 'toc' and active = 'T' group by navmenu order by navmenu";
$h_navmenu = mysql_query($q_navmenu,$connect);


while($rows = mysql_fetch_array($h_navmenu))
            {
                $navmenu = $rows["navmenu"];

                echo $navmenu . "<br>";
            }


-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux