Show image on div php codes
actually am retrieving image from the database and trying to show within an div tag.. i used <img src="<?php Print $a ?>" width="100" height="100" /> which doesnt work.. Pls Help me
<?php
header('Content-Type: image/jpg');
define('MYSQL_USER', 'root');
define('MYSQL_DB', 'upload');
define('MYSQL_HOST', 'localhost');
define('MYSQL_SERVER', 'localhost');
$con = mysql_connect(MYSQL_HOST,MYSQL_USER);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(MYSQL_DB, $con);
$query = 'SELECT * FROM `file` order by id desc limit 1';
// Execute the query
// $result = $dbLink->query($query);
$result = mysql_query($query) or die(mysql_error());
//$content='';
while($row = mysql_fetch_array( $result )) {
$a = $row['data'];
$a++;
}
//echo '<div style="width:200px; height:200px;">';
sleep(2);
print $a;
//echo '</div>';
//echo '<p><a href="test_image.php">Back to Main page</a></p>';
?>
<html>
<head>
</head>
<body>
<img src="../quark_new/Images/icon-loading-animated.gif" width="100" height="100" />
</body>
</html>
actually am retrieving image from the database and trying to show within an div tag.. i used <img src="<?php Print $a ?>" width="100" height="100" /> which doesnt work.. Pls Help me
<?php
header('Content-Type: image/jpg');
define('MYSQL_USER', 'root');
define('MYSQL_DB', 'upload');
define('MYSQL_HOST', 'localhost');
define('MYSQL_SERVER', 'localhost');
$con = mysql_connect(MYSQL_HOST,MYSQL_USER);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(MYSQL_DB, $con);
$query = 'SELECT * FROM `file` order by id desc limit 1';
// Execute the query
// $result = $dbLink->query($query);
$result = mysql_query($query) or die(mysql_error());
//$content='';
while($row = mysql_fetch_array( $result )) {
$a = $row['data'];
$a++;
}
//echo '<div style="width:200px; height:200px;">';
sleep(2);
print $a;
//echo '</div>';
//echo '<p><a href="test_image.php">Back to Main page</a></p>';
?>
<html>
<head>
</head>
<body>
<img src="../quark_new/Images/icon-loading-animated.gif" width="100" height="100" />
</body>
</html>