I have a dropdown list that needs to change the following php mysql query dynamically. Specifically the WHERE section. So the dropdown has CATERING, ENTERTAINMENT, VACATIONS, etc. So if someone chooses VACATIONS, the query below will swap entertainment with tblclients.category = 'Vacations' and the results on the page will change.
PHP
$query = mysql_query("SELECT * FROM tblClients WHERE tblclients.package = 'standard' and tblclients.category = 'Entertainment' LIMIT 0, 9", $connection);
JQUERY - I figured out how to get the following script to know what dropdown list option is selected, but only figured out how to show/hide a DIV.
<script>
$(document).ready(function(){
$('.dropdown .Catering').click(function(){
$('#page_featured_container').show();
});
$('.dropdown .Entertainment').click(function(){
$('#page_featured_container').show();
});
$('.dropdown .Vacations').click(function(){
$('#page_featured_container').show();
});
</script>
HTML Just for a full reference, My Dropdown list looks like such.
<section class="main">
<div class="wrapper">
<div id="dd" class="wrapper-dropdown-3" tabindex="1">
<span>View By Category</span>
<ul class="dropdown">
<?php while ($rows = mysql_fetch_array($query_category)) { ?>
<li><a class="<?php echo $rows['category']; ?>"><?php echo $rows['category']; ?></a></li>
<?php } ?>
</ul>
</div>
</div>
</section>
So, In theory, my JQUERY would like this...
<script>
$(document).ready(function(){
$('.dropdown .Catering').click(function(){
CHANGE PHP WHERE STATEMENT AND DISPLAY NEW RESULTS.