title: MySQL query in PHP with an array in the condition
body: <p>I'm doing a MySQL query in a PHP file. I have an array ($country) with multiple names of countries and I want to select the rows of those countries from my table. </p>
  
  <p>$country is the following array:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Afghanistan
      [1] =&gt; Armenia
      [2] =&gt; Bhutan
  )
  </code></pre>
  
  <p>I'm using the following code:</p>
  
  <pre><code>$result = mysqli_query($con,"SELECT * 
                               FROM table1 
                               WHERE table1.country='".$country."'");
  </code></pre>
  
  <p>However, the following statement works for an only country:</p>
  
  <pre><code> $result = mysqli_query($con,"SELECT * FROM table1 WHERE table1.country='".$country[1]."'");
  </code></pre>
  
  <p>But it doesn't work, whn I try:  mysqli_num_rows() of the $result it says that the parameter is a booelan(That's because the query fails and it returns a false). Does anyone know what is the error?</p>
  
  <p>This is the table1 structure:</p>
  
  <p><a href="https://i.stack.imgur.com/RKEdn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RKEdn.png" alt="enter image description here"></a></p>