Php help please?

Status
Not open for further replies.

mannythubbo

New Member
Jan 26, 2012
6
2
Ok so im going for the habbo avatars sorta thing for revCMS here what i have so far

PHP:
<div class="other-avatars">
 
<?php
 
$getItems = mysql_query("SELECT * FROM users WHERE mail = '['mail']' ORDER BY order_id ASC");
$evenOdd = 'odd';
$look = mysql_result(mysql_query("SELECT look FROM users WHERE mail = '['mail']' LIMIT 1"),0);
$login = mysql_result(mysql_query("SELECT last_online FROM users WHERE mail = '['mail']' LIMIT 1"),0);
$name = mysql_result(mysql_query("SELECT username FROM users WHERE mail = '['mail']' LIMIT 1"),0);
while ($item = mysql_fetch_assoc($getItems))
{
    if ($evenOdd == 'odd')
    {
        $evenOdd = 'even';
    }
    else
    {
        $evenOdd = 'odd';
    }
   
    echo '<li class="' . $evenOdd . '">
 
                      <img src="http://www.hublake.co.uk/hubbo-imaging/avatar.php?figure=<?php echo $look; ?>" width="33" height="56"/>
 
                      <div class="avatar-info">
 
                      <div class="avatar-info-container">
 
                      <div class="avatar-name"><?php echo $name; ?></div>
 
                  <div class="avatar-lastonline">Last logged in: <span title="<?php echo $login; ?>">Then</span></div>
 
                        </div>
 
                          <div class="avatar-select"><a href=""><b>Play</b><i></i></a></div>
 
                      </div>
 
                    </li> ';
 
}
?>
 
            </div>
 
        </div>
 
    </div>
 
    <div class="pick-avatar-container-bottom"></div>
 
  </div>

The usernames dont show, the images up as

And the last login doesant work Can anyone help me? For a example goto habbo.com and click on your avatar
 

Heaplink

Developer & Designer
Nov 9, 2011
510
173
Because you do not end your echo. You do not need to start and end PHP inside PHP and you can't do that in echo.

Change all your <?php echo $yourvar ?> to ' . $yourvar . ' for example. Remember the ' (single quote)
 
Status
Not open for further replies.

Users who are viewing this thread

Top