Page 1 of 1

Duplicate results

Posted: Sun Nov 21, 2004 3:07 am
by Perfidus
The following query:

$getiplist = mysql_query($questions, $link)or die(mysql_error());
$numofips = mysql_num_rows($getiplist);

Gaves me a result of 21.

If I echo the results:

while($row = mysql_fetch_array($getiplist))
{
foreach($row as $column)
echo $row['e_mail_rest']."<br>";}

I get 42 results, each result is being duplicated so I get each twice.
I'm trying to see where am I stumbling but I do not get it.
Where's the stupid mistake?

Posted: Sun Nov 21, 2004 3:18 am
by potsed
why do you have the foreach u r already looping through the results with the while

Code: Select all

while($row = mysql_fetch_array($getiplist)) { 
    echo $row['e_mail_rest']."<br>";
}
And may i ask why have you posted this question twice??

Posted: Sun Nov 21, 2004 11:34 am
by John Cartwright
Lol i was thinking in my head, where the hell did my post go :P