title: Can't display query when using inner join with php?
body: <p>I have a drop down menu form like so: <a href="https://ibb.co/eX5BhH" rel="nofollow noreferrer">https://ibb.co/eX5BhH</a></p>
  
  <p>Each selected option will filter the query and return the query. So far, my "disability" and "veteran" option are querying correctly. I'm trying to get the "Type of Resource" category to work by using inner join. Here's the sql command:</p>
  
  <pre><code>SELECT shelter_name, shelter_address, disability, veteran 
  FROM shelter s
  INNER JOIN shelter_type st ON s.shelter_id = st.shelter_id
  INNER JOIN s_type stt on st.type_id = stt.type_id
  WHERE type_name = "Charitable Organization";
  </code></pre>
  
  <p>This sql command works but it only query the resources under the "Charitable Organization" category. The user will be able to choose other category so instead of "Charitable Organization" I replace it with "$value_4":</p>
  
  <pre><code>SELECT shelter_name, shelter_address, disability, veteran 
  FROM shelter s
  INNER JOIN shelter_type st ON s.shelter_id = st.shelter_id
  INNER JOIN s_type stt on st.type_id = stt.type_id
  WHERE type_name = "$value_4";
  </code></pre>
  
  <p>Here is my php code:</p>
  
  <pre><code>&lt;?php
  
  require'/Library/WebServer/Documents/Require/require.php';
  
  $value_1 = $_POST["county"];
  $value_2 = $_POST["disability"];
  $value_3 = $_POST["veteran"];
  $value_4 = $_POST["resources"];
  
  
  
  $sql = "SELECT shelter_name, shelter_address, disability, veteran 
          FROM shelter s 
          INNER JOIN shelter_type st ON s.shelter_id = st.shelter_id 
          INNER JOIN s_type stt on st.type_id = stt.type_id 
          WHERE type_name = '$value_4'";
  
  $result = mysqli_query($dbc, $sql) or die (mysql_error());
  
  echo"&lt;table border='1'&gt;";
  echo"&lt;tr&gt;&lt;td&gt;Shelter&lt;/td&gt;&lt;td&gt;Address&lt;/td&gt;&lt;td&gt;Disability&lt;/td&gt;&lt;/tr&gt;";
  
  //iterate through the table
  while ($row = mysqli_fetch_assoc($result)){
  
     echo"&lt;tr&gt;&lt;td&gt;{$row['shelter_name']}&lt;/td&gt;&lt;td&gt;{$row['shelter_address']}&lt;/td&gt;&lt;td&gt; {$row['disability']}&lt;/td&gt;&lt;td&gt;{$row['veteran']}&lt;/td&gt;&lt;/tr&gt;";
  
  }
  
  echo"&lt;/table&gt;"; //close table
  
  echo"success";
  ?&gt;
  </code></pre>
  
  <p>However, when I use "$value_4", the table doesn't display. If I change it back to "Charitable Organization", the table is displayed again. What can I do to make my table display when I use "$value_4"?</p>