есть запрос к БД кратко о запросе... Нужно запросить все данные указанные в фильтрах в один запрос прописую 3 фильтра в запросе работать не хочет..а по одному мне сказали не делать как мне вставить в запрос 3 фильтра и что бы они работали? <?php include_once 'connect.php'; $tour = $_POST['tour_id']; $region = $_POST['region_id']; $country = $_POST['country_id']; $filter_tour="regions.tour_id=tours.tour_id AND countries.region_id=regions.region_id AND tours.tour_id=$tour"; $filter_regions="countries.region_id=regions.region_id AND regions.tour_id=tours.tour_id AND regions.region_id=$region"; $filter_country="countries.country_id=$country AND countries.region_id=regions.region_id AND regions.tour_id=tours.tour_id"; if ($tour) { $result = mysql_query("SELECT * from tours,regions,countries WHERE $filter_tour "); while ($row_all = mysql_fetch_array($result)) { $name_t = $row_all['name_t']; $name_r = $row_all['name_r']; $name_c = $row_all['name_c']; $name_c_price = $row_all['price_c']; echo "<table align='center' cellspacing='2' cellpadding='2' border='1' style='border:0px solid #000'>"."<tr>"; echo "<td width='150' align='center'>".$name_t."</td>"; echo "<td width='150' align='center' style='color:#666'>".$name_r."</td>"; echo "<td width='150' align='center'>".$name_c."</td>"; echo "<td width='150' align='center' style='color:red'>".$name_c_price." грн. "."</td>"; echo "</tr>"."</table>"; } }
$sql = 'бла-бла-бла;'; $result = mysql_query($sql);