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> <? } ?> Quote Link to comment 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"> Quote Link to comment 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> 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.