Jump to content

members not displaying how i want it


zhshero

Recommended Posts

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

currentq.png

 

and i want it to show up like this

howiwantit.png

 

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

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.