.Hi guys i have been working on a picture viewer and what i want to do is put certain informations over the pictures that is retrieved from the database.
i used the following code to retrieve images from the database:
<?php
$host = 'localhost';
$user = '';
$pw = '';
$db = 'dbhere';
mysql_connect($host,$user,$pw);
mysql_select_db($db);
$pid = 10;
$sql = "select pics, ext from infopics where id='10'";
$result = mysql_query($sql) or die('Bad query at 12!'.mysql_error());
while($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
$db_img = $row['pics'];
$type = $row['ext'];
}
$img = base64_decode($db_img); //print_r($db_img );
$img = imagecreatefromstring($img);
header("Content-Type: image/png");
imagejpeg($img);
imagedestroy($img);
$string = $_GET['text'];
?>
saved as picture.php
.and i used a tag like this on the other php page to fetch the retrieved image from above:
<a id="example8" href="#" title="" ?><img class="last" src="picture.php?text=text" /></a>
.I also placed informations about the pictures on the database which i have retrieved and displayed on my info.php and i want to place it over the image. like on the following link:
the third one placed on the
Different title positions - 'outside', 'inside' and 'over.
the "over" one.
The title that you will supply on the <a> tag will be the one to be posted over the image. is there a chance that i get the texts from my info.php and place it on the title="" attribute of my <a> tag?
by the way this is the code i used for my info.php:
<?php
$host = 'localhost';
$user = 'root';
$pw = '';
$db = 'thepillar';
mysql_connect($host,$user,$pw);
mysql_select_db($db);
$sql = "select name, nickname from infopics where id='1'";
$result = mysql_query($sql) or die('Bad query at 12!'.mysql_error());
while($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
$name = $row['name'];
$nickname = $row['nickname'];
}
echo "<table style='padding:0px'>
<tr>
<td>
$nickname
</td>
</tr>
<tr>
<td>
$name
</td>
</tr>
</table>";
?>