zhshero Posted November 16, 2010 Share Posted November 16, 2010 i been working on my view Members page for a while now i can't seem to get it to work right this is how i shows up for me and i want it to show up like this i think it has something to do with the loop, but have no idea how to fix this :S <?php require_once('settings.php'); checkLogin('1 2'); $Members = mysql_query("SELECT * FROM users") or die(mysql_error()); $numRowsMembers = mysql_num_rows($Members); ?> <?php for($count = 1; $count <= $numRowsMembers; $count++) { $name = mysql_fetch_array($Members); ?> <table border=2> <tr><td><img src="<? echo $name['main_P']?>" width="50" height="50"/> <a href="view_profile.php?username=<? echo $name['Username']?>"><? echo $name['Username']?></a> <? $onlinestatus = $name['ON_OFF']; if ( $onlinestatus == OFFLINE ) { echo ""; } else { echo "<font color=green>Online Now!</font>"; } ?> </td></tr></table> <? } ?> Link to comment https://forums.phpfreaks.com/topic/218875-members-not-displaying-how-i-want-it/ Share on other sites More sharing options...
AbraCadaver Posted November 16, 2010 Share Posted November 16, 2010 This is just basic HTML/CSS. You would probably be better off using DIVs and styles to control the layout, but I think if you do this it will work: <table style="float: left"> Link to comment https://forums.phpfreaks.com/topic/218875-members-not-displaying-how-i-want-it/#findComment-1135142 Share on other sites More sharing options...
zhshero Posted November 16, 2010 Author Share Posted November 16, 2010 This is just basic HTML/CSS. You would probably be better off using DIVs and styles to control the layout, but I think if you do this it will work: <table style="float: left"> if i do it that why, i'll get what i want, but then everything is to the left of the screen i wanted to keep it ceneter what i have now works <center><table border=2 width="250" height="125"><tr> <? $Members = mysql_query("SELECT * FROM users") or die(mysql_error()); $numRowsMembers = mysql_num_rows($Members); ?> <?php for($count = 1; $count <= $numRowsMembers; $count++) { $name = mysql_fetch_array($Members); ?> <td width="150" height="125"> <a href="view_profile.php?username=<? echo $name['Username']?>"><img src="<? echo $name['main_P']?>" width="100" height="100"/> <? echo $name['Username']?></a> <? $onlinestatus = $name['ON_OFF']; if ( $onlinestatus == OFFLINE ) { echo ""; } else { echo "<font color=green>Online</font>"; } ?> </td> <? } ?> </tr></table> Link to comment https://forums.phpfreaks.com/topic/218875-members-not-displaying-how-i-want-it/#findComment-1135146 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.