title: Select Multiple Ids from a table
body: <p>I want to select some id's based on url string but with my code it displays only the first.
  If i write manual the id's it works great.</p>
  
  <p>I have a url like this <a href="http://www.mydomain.com/myfile.php?theurl=1,2,3,4,5" rel="noreferrer">http://www.mydomain.com/myfile.php?theurl=1,2,3,4,5</a> (ids)</p>
  
  <p>Now in the myfile.php i have my sql connection and:</p>
  
  <p><code>$ids = $_GET['theurl']; (and i am getting 1,2,3,4,5)</code></p>
  
  <p>if i use this:</p>
  
  <pre><code>$sql = "select * from info WHERE `id` IN (1,2,3,4,5)";
  $slqtwo = mysql_query($sql);
  while ($tc = mysql_fetch_assoc($slqtwo)) {
      echo $tc['a_name'];
      echo " - ";
  }
  </code></pre>
  
  <p>I am Getting the correct results. Now if i use the code bellow it's not working:</p>
  
  <pre><code>$sql = "select * from info WHERE `id` IN ('$ids')";
  $slqtwo = mysql_query($sql);
  while ($tc = mysql_fetch_assoc($slqtwo)) {
      echo $tc['a_name'];
      echo " - ";
  }
  </code></pre>
  
  <p>Any suggestions?</p>