Re: Is there a brian I can pick?

From: Date: Mon, 26 Jul 2004 19:38:27 +0000
Subject: Re: Is there a brian I can pick?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-191909@lists.php.net to get a copy of this message
> I need to kill that extra Texas and Virgina.....here's how I'm doing this: > > <table border=1> > <? > $query=mysql_query("SELECT DISTINCT state FROM members WHERE > country='US' ORDER BY state ASC"); > while($q=mysql_fetch_array($query)) { > $q1=mysql_fetch_array($query); > $q2=mysql_fetch_array($query); > $q3=mysql_fetch_array($query); > $q4=mysql_fetch_array($query); > > (4 Switch statements here one for q1, q2, q3, q4) > ?> > > <tr><td><?= $state1 ?></td><td><?= $state2 > ?></td><td><?= $state3 > ?></td><td><?= $state4 ?></td></tr> > > <? > } > ?> I would change the loop so you are only calling mysql_fetch_array once. Are you sure that this loop is working correctly? at the bottom of your while loop try this: unset($state1,$state2,$state3,$state4,$q1, $q2, $q3, $q4);

« previous php.general (#191909) next »