Then i said correct. Your table will be like this:
imgsrc | url
-------------------------------------
images/pic1.jpg | http://www.xyz.com
images/pic2.jpg | http://www.ccc.com
images/pic3.jpg | http://www.dsd.com
If you are doing it with php, your query will be like this:
Code:
<?php
$result = mysql_query("SELECT * FROM mytable");
while($rows = mysql_fetch_array($result, MYSQL_ASSOC)){ //this will get all rows
$img = $rows['imgsrc']; //imgsrc coloumn
$url = $rows['url']; //url coloumn
echo"<a href=".$url."><img src=".$img." /></a> <br/>"; //echo image and url
}
?>
Output will be:
Code:
<a href="http://www.xyz.com"><img src="images/pic1.jpg"/></a>
<a href="http://www.ccc.com"><img src="images/pic2.jpg"/></a>
<a href="http://www.dsd.com"><img src="images/pic3.jpg"/></a>
This output is just it's source. But it will be like image and when you click it goes to that url.
I wish it will help you.
Bookmarks