Jump to content

Small problem, Not outputting. *SOLVED*


xyn

Recommended Posts

Hio,
I'm having a small problem with PHP, he seems to be getting
on my nerves tonight, well the thing is I have a avatar for
my members, yet I wanted to check if they ahve an avatar
or give them the default avatar.

So I check mysql as you do, and PHP doesn't seem to output
anything :/ could someone check my code, thx.

[code=php:0]<?PHP include("session.php");
$SQLB = mysql_query("SELECT filename FROM avatar WHERE user='{$_SESSION['username']['usr_user']}'");
while( $Data = mysql_fetch_array( $SQLB, MYSQL_NUM )){
$NUMB = mysql_num_rows( $SQLB );
if( !$NUMB ){
$avatar="avatar.PNG";
}else{
$avatar = $Data[0];
}
}
?>
<p>text here<br>
<img border="0" src="./global/images/private/<?PHP echo $avatar; ?>" alt="Avatar"></p>[/code]
Link to comment
Share on other sites

[code]<?php
include("session.php");
$SQLB = mysql_query("SELECT filename FROM avatar WHERE user='{$_SESSION['username']['usr_user']}'");
$NUMB = mysql_num_rows( $SQLB );
if( !$NUMB ){
    $avatar="avatar.PNG";
}else{
    $Data = mysql_fetch_array( $SQLB, MYSQL_NUM );
    $avatar = $Data[0];
}
?>
<p>text here<br>
<img border="0" src="./global/images/private/<?php echo $avatar; ?>" alt="Avatar"></p>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.