Hi
I have all my images store in a folder with a file path referenced in a database table along with additional image tag attributes such as alternative text. I have managed to output the image to the browser without an issue but when i try to add the alt text from the database there is no closing tag for the image tag.
I have noticed from looking at the outputted html that it there is no space between the src and alt attributes which is i assume is the reason why it cant find the closing part of the image tag.
This is the code i have so far, does anyone know how to put a space between the src and alt attributes or a better way to output the image altogether. I am grateful of any help
<?
$image =@mysql_query("SELECT * FROM tblphoto WHERE photoid='1'");
if (!$image) {
exit('<p>Error Performing query: ' . mysql_error() . '</p>');
}
while ($row = mysql_fetch_array($image)) {
echo "<img src=".$row['photosrc']. "alt=" .$row['altText']."/>";
}
?>
and this has the following effect in HTML
<img src="../images/meeting.jpg"alt="Meeting of CDM coordinators"/>