mycosis Posted September 24, 2006 Share Posted September 24, 2006 [code]<?include("db.inc.php");//statmysql_connect($db,$username,$password);@mysql_select_db($database) or die( "Unable to select database");$query="SELECT * FROM ipstats";$result=mysql_query($query);$num=mysql_numrows($result);mysql_close();$i=0;while ($i < $num) {$id=mysql_result($result,$i,"id");$ip=mysql_result($result,$i,"ip");$on=mysql_result($result,$i,"online");$lu=mysql_result($result,$i,"last_used");echo"<table width='600' border='1' cellspacing='0' cellpadding='0'> <tr> <td width='200' align='left' valign='top'>ID: $id<br />IP: $ip<br />$online<br />Sisst sett: $lu</td> <td width='400' align='left' valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>";// Slutt stat// Start nickstatmysql_connect($db,$username,$password);@mysql_select_db($database) or die( "Unable to select database");query$query2="SELECT * FROM `ipstats_nicks` WHERE ipstats_id =$idORDER BY nick ASC";$result2=mysql_query($query2);$num2=mysql_numrows($result2);mysql_close();echo"<tr> <td>Nick:</td> <td>Brukt:</td> <td>Online:</td> <td>Sisst brukt:</td> </tr>";while ($i2 < $num2) {$nick=mysql_result($result2,$i2,"nick");$brukt=mysql_result($result2,$i2,"used_times");$onnick=mysql_result($result2,$i2,"online");$lunick=mysql_result($result2,$i2,"last_used");echo" <tr> <td>$nick</td> <td>$brukt gang(er) </td> <td>$onnick</td> <td>$lunick</td> </tr>";$i2++;}// Slutt nickstat// Start statecho"</table> </td> </tr></table><br /><br />";$i++;}?>[/code]It is two record in the DB (see here: http://elmannen.net/dc%20stats/), but the second onne isn't getting any result. why?I think its because $query2 and those come again at second loop...PLZ help, how can i get it going? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.