我想在使用三个表时从 mytable 中选择项目并 &_GET 在此页面中打开另一个 id,所以我想使用 where 和 where 使用两个角色来完成获取我的数据。
<?php
$sel = "SELECT * FROM `informations` where `cate_id` =".$_GET['info_id'];
$done = mysql_query($sel);
?>
<form action="" method="post" enctype="multipart/form-data">
<label for="location"></label>
<select name="location" id="location"><?php
$sel_cate = "SELECT * FROM locations";
$done_cate = mysql_query($sel_cate);
while($get_cate = mysql_fetch_array($done_cate)){
echo '<option value="'.$get_cate['id'].'">'.$get_cate['location'].'</option>';
$loc=$get_cate['id'];
}
?>
</select>
<input type="submit" name="go" id="go" value="Go">
<input type="submit" name="all" id="all" value="Show All...">
</form>
<?php
if(isset($_POST['go'])){
$sel ='SELECT * FROM `pharmacies` WHERE `cate_id` ="'.$_GET['info_id'].'" || `location_id` = "'.$_POST['location'].'"';
?>