title: Multiple PHP variables in MYSQL query with AND condition
body: <p>This is my first code-question! I'm a beginner at both MySQL and PHP, so this might be really simple! Here is my code:</p>
  
  <p>This is a file included in my Index.php...:</p>
  
  <pre><code>&lt;?php
  $query="SELECT * FROM wines WHERE Type='$type' AND Country='$country'";
  $products=mysql_query($query);
  ?&gt;
  </code></pre>
  
  <p>And these are the variables set with the $_GET function:</p>
  
  <pre><code>&lt;?php
  $type=$_GET['type'];
  $fruit=$_GET['fruit'];
  $country=$_GET['country'];
  ?&gt;
  </code></pre>
  
  <p>And then later I'll fetch the array and work with it.</p>
  
  <p>The problem is that my $query works fine with just the '$type'-variable, but not with the $country -variable - - - - or any other variable I've tried.</p>
  
  <p>I use Microsoft Webmatrix and it tells me that the issue arises the very moment I type in the $-sign in the second variable...</p>
  
  <p>So confused! Hope you can help a newcomer :)</p>
  
  <p>EDIT: I found out the problem was with the "ticks" around my variables. The correct way to do it is with backticks ( `` ). Also, I started using PDO and MySQLi instead of mysql. For beginners, MySQLi is probably the easiest. Started sanitizing too.</p>