0

my code for show avatar but image not display . how to correct the code

<?php

require 'connect.php';
$userg      = mysql_query("SELECT avatar FROM members")
    or die("Failed to fetch your details.");
                            
if (isset($_SESSION['MM_Username'])){
echo "Welcome ".$_SESSION['MM_Username'];
echo "<img src=";
echo $userg;
echo "></img>";

}
?>
2
Contributors
3
Replies
6
Views
6 Years
Discussion Span
Last Post by karthik_ppts
0

$userg is result set not your field value...

So replace your line no 11 with

echo mysql_result($userg,0,"avatar");
0

please can you help me for define image size and width on this code

<?php
 
require 'connect.php';
$userg      = mysql_query("SELECT avatar FROM members")
    or die("Failed to fetch your details.");
 
if (isset($_SESSION['MM_Username'])){
echo "Welcome ".$_SESSION['MM_Username'];
echo "<img src=";
echo mysql_result($userg,0,"avatar" );
echo "></img>";
 
}
?>

my code for show avatar but image not display . how to correct the code

<?php

require 'connect.php';
$userg      = mysql_query("SELECT avatar FROM members")
    or die("Failed to fetch your details.");
                            
if (isset($_SESSION['MM_Username'])){
echo "Welcome ".$_SESSION['MM_Username'];
echo "<img src=";
echo $userg;
echo "></img>";

}
?>
0
<?php
     
		require 'connect.php';
		$userg = mysql_query("SELECT avatar FROM members") or die("Failed to fetch your details.");
		 
		if (isset($_SESSION['MM_Username']))
		{
			echo "Welcome ".$_SESSION['MM_Username'];
			echo "<img src=".mysql_result($userg,0,"avatar" )." width=200 height=200>";
     	}
    ?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.