Code: Select all
<?php
require_once('db.php');
$query = mysql_query("SELECT * FROM image WHERE thumb = '1'");
while($row = mysql_fetch_assoc($query)) {
?>
<ul>
<li><a href="house.php?id=<?php echo $row['address']; ?>"><img src="upload/<?PHP echo $row['imagedata']; ?>" width="150" height="150" border="1" /></a></li>
</ul>
<?php } ?>Code: Select all
<?php
require_once('db.php');[*][*]
$address = $_GET['address'];
query = mysql_query("SELECT * FROM image WHERE address = $address");
while($row = mysql_fetch_assoc($query)) {
?>
<ul>
<li><img src="upload/<?php echo $row['imagedata']; ?>" width="150" height="150" border="1" /></a></li>
</ul>
<?php } ?>pid title address thumb imagedata
1 house carnegie 1 se234.jpg
2 farm carnegie 2 4hgh45.jpg
1 bed oakleigh 1 htgy4.jpg
1 hotel springvale 1 55fs.jpg
because each house may have more than 1 image, so I use address to identify different houses. thumb = 1 mean this image will be used as a thumbnail for people to click, thumb = 2 will be the images on house.php if people click the carnegie house, on the house.php, 'house' and 'farm' will be displayed on house.php
I wish people understand what i am doing. this looks simple, but I just couldnt get it work properly.
thanks for help