Hi,
the code below is trying topull out the image from the database. When the image code is taken before the text that is being displayed from the database then it pulls out the image. if the code is written after the text being displayed from the database then it does not work. can some one help me please.

many thanks

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?
$username="proper_asik112";
$password="ashik112";
$database="proper_contacts";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$result = mysql_query('SELECT * FROM contacts 
WHERE id=\''. $_GET['id'].'\'');; 
?>
<?
while($row=mysql_fetch_array($result))
{

echo ' '. $row['first'] .' '. $row['last'] .' ';

}
?>
<img name="fff" img src="<? while($row=mysql_fetch_array($result))
{
echo ''. $row['picture'] .'';
}
?>" width="529" height="374" alt=""> 

</body>
</html>

I would solve it a bit different, because some browsers have problems displaying images like this.

Write another PHP-File that just outputs the image. Then use

<a href="image.php?id=1">

in your first script.

I hope that helps.
Simon

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.