Trying to retrieve a value from Mysql db
Posted: Thu Mar 26, 2009 4:48 am
Hi
I have a table in mysql called tbl_picture_link which stores a url string to some pictures not I would like to retieve the string and place <img> around it.
This is the function I have
I'm not getting an errors with connection to my db all that its echoed is an img place holder the $query value which is a value sql statement because I copied the output and ran it in phpmyadmin and it returned some the result I was expecting.
Any ideas what could be wrong.
I have a table in mysql called tbl_picture_link which stores a url string to some pictures not I would like to retieve the string and place <img> around it.
This is the function I have
Code: Select all
function get_image($image_id){
//finds and displays the selected image
global $connection;
$query = "SELECT *
FROM tbl_picture_link
where picture_link_id = {$image_id}
LIMIT 1";
$picture_set = mysql_query($query, $connection);
confirm_query($picture_set);
echo "<img scr=\"" . $picture_set['picture_link_href'] . "\">" . $query."<br />";
}Any ideas what could be wrong.