i want to search two categories at the same time.

Codes here !

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Fri Dec 07, 2012 5:39 pm

i want to search two categories at the same time.

Postby sinanqd10 » Fri Dec 07, 2012 5:42 pm

please kindly help me to figure out the solution
The question is below;
So three ways this can happen.

Search by locations ONLY
Search by categories ONLY
Search by categories within locations

I have two problems.

I can get scenarios 1 & 2 to work, but only if ONE checkbox is selected.
I have no idea how to even begin to get scenario 3 to work.
Here is what I have for scenario 1 & 2

<?php include_once('common/define.inc.php'); ?>
<!DOCTYPE html>
<meta charset="utf-8" />
<form action="common/filter.php?page=emp" method="post">
<label> Category: </label>
<select name="job_type" style="width: 221px;">
<option value="0"> Job type... </option>
$cat = $db->query("SELECT tax_id, title FROM `taxonomy` WHERE ftax_id=32 ORDER BY title ASC");
while($job = $cat->fetch_assoc()) {
echo '<option value= "'.$job["title"].'"'.(($_SESSION["filter_cat"]==trim($job["title"]))? 'selected="selected"':'').'> '.$job["title"].' </option>';
<?php } ?>
<label> Location: </label>
<select name="job_location">
<option value="0"> Job Location... </option>
$cat = $db->query("SELECT title FROM `taxonomy` WHERE ftax_id=1 ORDER BY title ASC");
while($location = $cat->fetch_assoc()) {
echo '<option value= "'.$location["title"].'"'.(($_SESSION["filter_locat"]==tr

Return to “mySQL & php coding”

Who is online

Users browsing this forum: Baidu [Spider] and 6 guests