title: how to retrieve the data from two table in mysql database with if condition in php mysql
body: <p><img src="https://i.stack.imgur.com/lTZJA.jpg" alt="table design "></p>
  
  <p>my code is </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;body&gt;
  &lt;div style="width:400px;height:300px;border:1px solid blue;"&gt; 
  &lt;div style="width:400px;height:50px; float: left;"&gt;&amp;nbsp;&lt;/div&gt;
  &lt;form&gt;
  &lt;div align="right" style="width:150px;height:30px; float: left;"&gt;Show Name :&amp;nbsp;    &lt;/div&gt;
  &lt;div style="width:250px;height:30px; float: left;"&gt;
  &lt;select name="show_name" onchange="showUser(this.value)"&gt;
  &lt;option selected="selected"&gt; -- Select The Show --&lt;/option&gt;
  &lt;?php   
  session_start();
  include_once('db.php');
  $sql = mysql_query("SELECT show_id, show_name FROM show_name");
  while($row=mysql_fetch_array($sql))
  {
  $show_id = $row['show_id'];
  $show_name= $row['show_name'];
  echo "&lt;option value ='.$show_id'&gt;$show_name&lt;/option&gt;";
  }
  ?&gt;
  &lt;/select&gt;
  &lt;/div&gt;
  &lt;div align="right" style="width:150px;height:30px; float: left;"&gt;Show Place :&amp;nbsp;      &lt;/div&gt;
  &lt;div style="width:250px;height:30px; float: left;"&gt;
  &lt;select name="show_place" onchange="showUser(this.value)"&gt;
  &lt;option selected="selected"&gt; -- Select The Show Place --&lt;/option&gt;
  &lt;?php   
  $sql = mysql_query("SELECT * FROM show_name, show_place WHERE    show_name.show_id=show_place.show_id");
  while($row=mysql_fetch_array($sql))
  {
  $show_id = $row['show_id'];
  $show_place = $row['show_place'];
  echo "&lt;option value ='.$show_id'&gt;$show_place&lt;/option&gt;";
  }
  ?&gt;
  &lt;/select&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i want to option box condition for stud show to select the particular place .. please guide me how to merge the two table by using if condition or foreach condition </p>