plz help me...that how can i display images only related to specific category after click on "more" link....
like...i have 9 categories each category have some images....
for example...i have category "A" & "B".... Both categories have some images...if i click on more button...then images should be display only related to that "A" category...
plz see the code below....
Code: Select all
<?php
include('dbconnect.php');
//$category=$_GET['cat'];
$query="SELECT C.category_name, P.Item_image, P.Item_category FROM category_table AS C
INNER JOIN item_table AS P ON c.category_name = p.Item_category
WHERE p.Item_image = (
SELECT p2.Item_image FROM item_table p2
WHERE c.category_name = p2.Item_category LIMIT 1 )" ;
$result=mysql_query($query);
$num1=mysql_num_rows($result);
$j=$num1;
?>
<body>
<marquee direction="up" onmouseover="this.stop()" onmouseout="this.start()">
<?php
while ( $row = mysql_fetch_array($result))
{
?>
<table>
<tr>
<td valign="top">
<p align="justify" ><?php echo $row[0]; ?></p>
</td>
<?php
echo "<br>";
?>
<td> </td>
<td valign="baseline">
<img src="<?php echo $row[1];?>" width="100px" height="100px" /></td>
<td> </td>
<td valign="bottom"><a href="photo2.php">More</a></td>
</tr>
</table>
<?php
}
?>
</marquee>