I have an unordered list which somebody can search for images which belongs in current category. i have this code in a while loop:
<li><a class="ct" href="account.php?view_templates&category=<?php echo $category['id']; ?>"><?php echo $category['name']; ?></a></li>
Also i have an unordered list which somebody can search for images which belongs in a current size.I have used jquery to get the li value and send it via ajax to php file to give me the results.
<li value="728x90"><a href="#">728x90</a></li>
I get the results using this code to my php file:
if(isset($_POST['size'])){
$size = $_POST['size'];
$gs = $db->query("SELECT * FROM images WHERE size = '$size'");
while($images = $gs->fetch(PDO::FETCH_ASSOC)){
//I store the images here
}
}
The problem is that when somebody has selected a category and after that he trying to select a size, then as result i have only the size but no the current category. The wished result is to search the sizes but in the specific selected category..not to all categories.. how can i do that? Thanks..