halojoy wrote:He means you should look at the HTML: View Source
There is nothing wrong with your code, by my testing.
I get this output, if using path and name as variable values
<a href="path"><img src="path" border=0 alt="name"></a>
This should work if image exists.
So, would say your query does not return correct IMAGE PATH.
Here is the code I used for my test:
<?php
$row["imagepath"] = 'path';
$row["imagename"] = 'name';
echo "<a href=\"" . $row["imagepath"] .
"\"><img src=\"" . $row["imagepath"] .
"\" border=0 alt=\"" . $row["imagename"] . "\"></a>";
regars 🙂
halojoy
its not working at all. I have tried using your testing code above. This is my new code now...
<?php
require_once ('dbconnection.php');
$query = mysql_query ("SELECT * FROM image ORDER BY dateadded");
$row["imagepath"] = 'path';
$row["imagename"] = 'name';
echo "<a href=\"" . $row["imagepath"] .
"\"><img src=\"" . $row["imagepath"] .
"\" border=0 alt=\"" . $row["imagename"] . "\"></a>";
mysql_close();
?>
now all it displays on the page is "name" link and nothing else.
Please can you help. I have checked the image paths in the page source, and they match the ones in the directory, so that is not the problem. I want to display thumbnails of the images on this page, and when user clicks on the thumbnail a new page with the big image appears.
Thank you, i really appreciate your help.