Hi there.
I'm trying to do a last 7 Connections to the website but when i make it it just appears 1 user ill add here the image also
here is the code :
Code:
<h2 class="title">Ultimas Conecções</h2>
<?php
$q = mysql_query("SELECT user from log_connection ORDER by date DESC");
if (mysql_num_rows($q) < 1 )
{
echo "Theres no last connections.";
}
else
{
echo '<nav>
<ul>
<center><li><strong>'.mysql_result($q, 0, 'user').'</li></strong></center>
<center><li><strong>'.mysql_result($q, 0, 'user').'</li></strong></center>
<center><li><strong>'.mysql_result($q, 0, 'user').'</li></strong></center>
<center><li><strong>'.mysql_result($q, 0, 'user').'</li></strong></center>
<center><li><strong>'.mysql_result($q, 0, 'user').'</li></strong></center>
<center><li><strong>'.mysql_result($q, 0, 'user').'</li></strong></center>
<center><li class="last "><strong>'.mysql_result($q, 0, 'user').'</li></strong></center>
</ul>
</nav>
';
}
?>
image :
If theres no 7 users logs, the <li> will be as "Theres no more users" . any idea on how can i do it?
Thanks.