SirChick Posted December 21, 2007 Share Posted December 21, 2007 I am trying to create a table so it does something like this: IP1 Users Under This IP UserName UserName UserName IP2 Users Under This IP UserName UserName UserName I attempted it but i didnt manage it lol This is what i got i think its cos the while loop isn't working or i got the order of it wrong.. the ip's don't go left enough and it doesn't list the user names correctly: <?php $ID = 78; $GetIP = mysql_query("SELECT * FROM iplogs WHERE UserID='$ID'") or die(mysql_error()); If(mysql_num_rows($GetIP) < 1){ Header("location: adminpanel.php"); }Else{ include("londonpagesinclude.php"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>View Ips</title> </head> <div id="bv_" style="position:absolute;left:371px;top:276px;width:180px;height:29px;z-index:10" align="center"> <font style="font-size:24px" color="#FFFFFF" face="Arial"><b><u>Your Reports</u></b></font></div> <div id="bv_" style="position:absolute;left:325px;top:330px;width:250px;height:224px;z-index:0" align="center"> <a href="pendingreports.php" style="color:#FFFFFF">Back</a></div> <div id="bv_" style="position:absolute;left:300px;top:440px;width:250px;height:224px;z-index:0" align="center"> <table width="300" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="200"><font style="font-size:14px" color="#FFFFFF" face="Arial"><center><b><u>UserNames</center></b></u></font></td> </tr> <?php While($row = mysql_fetch_assoc($GetIP)){ $IP = $row['IP']; ?> <div id="bv_Text1" style="position:relative;left:10px;width:270px;height:16px;z-index:1" align="left"> <font style="font-size:13px" color="#FFFFFF" face="Arial"><b><?=$IP?></b></font></div> <?php $GetUsers = mysql_query("SELECT UserID FROM iplogs WHERE IP='$IP'") or die(mysql_error()); $GetUsersrow = mysql_fetch_assoc($GetUsers); $UserID = $GetUsersrow['UserID']; $GetName = mysql_query("SELECT Username FROM userregistration WHERE UserID='$UserID'") or die(mysql_Error()); $GetUsernamerow = mysql_fetch_assoc($GetName); $UserName = $GetUsernamerow['Username']; ?> <tr> <td width="100"><center><font style="font-size:14px" color="#FFFFFF" face="Arial"><?=$UserName?></center></font></td> </tr> </td> <?php } ?> </div> Link to comment https://forums.phpfreaks.com/topic/82705-while-loop-issue/ Share on other sites More sharing options...
SirChick Posted December 21, 2007 Author Share Posted December 21, 2007 bump Link to comment https://forums.phpfreaks.com/topic/82705-while-loop-issue/#findComment-420904 Share on other sites More sharing options...
MasterACE14 Posted December 22, 2007 Share Posted December 22, 2007 could you give us a screenshot of what the result is?? and this sounds like more of a HTML/CSS problem from the way you have explained the problem... Regards ACE Link to comment https://forums.phpfreaks.com/topic/82705-while-loop-issue/#findComment-420913 Share on other sites More sharing options...
janim Posted December 22, 2007 Share Posted December 22, 2007 i don't see what u want exactly but this may help you can't put <div> like this </tr> <div></div><tr>... you need to put it inside the <tr><td><div></div></td></tr> is that what you asking for ? Link to comment https://forums.phpfreaks.com/topic/82705-while-loop-issue/#findComment-420915 Share on other sites More sharing options...
SirChick Posted December 22, 2007 Author Share Posted December 22, 2007 Please see image i have attatched.. the IP's appear above the lists of users. But what is suppose to happen is list all users under each ip in this kinda layout: IP1 Users Under This IP UserName UserName UserName IP2 Users Under This IP UserName UserName UserName With this image i have attatched it should look like: IP1 Users Under This IP test IP2 Users Under This IP test But i cannot get the while loops correctly working. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/82705-while-loop-issue/#findComment-420921 Share on other sites More sharing options...
SirChick Posted December 22, 2007 Author Share Posted December 22, 2007 Is it still a html issue then or to do with while loops? Link to comment https://forums.phpfreaks.com/topic/82705-while-loop-issue/#findComment-420958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.