php - using multi where when select items from database -


i want selected items mytable when using 3 tables , &_get id open in page want use , complete fetch data using 2 roles .

<?php    $sel = "select * `informations` `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 * 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 * `pharmacies` `cate_id` ="'.$_get['info_id'].'" ||     `location_id` = "'.$_post['location'].'"';  ?> 

i tried code , when isset($_post['go']) variable $sel got $_get['info_id'] , $_post['location'] values. query generated without errors, , must fetch information.

i not see mysql_query in your: if(isset($_post['go'])). maybe forget query:

if(isset($_post['go'])) {   $sel = 'select * `pharmacies` `cate_id` ="'.addslashes($_get['info_id']).'" or `location_id` = "'.addslashes($_post['location']).'"';   $selrslt = mysql_query($sel);   while($row = mysql_fetch_array($selrslt))   {     var_dump($row);   } } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -