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
https://forums.phpfreaks.com/topic/21892-small-problem-not-outputting-solved/
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]

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.