Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

i want to search two categories at the same time.

Codes here !

Moderators: macek, egami, gesf

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>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<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>
<?php
$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 } ?>
</select>
<label> Location: </label>
<select name="job_location">
<option value="0"> Job Location... </option>
<?php
$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
sinanqd10
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri Dec 07, 2012 5:39 pm

Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.