title: PHP/SQL Checking if a value already exists in a database
body: <p>I am using the following code to check if an email address exists in a database
  I am getting the email value from an HTML form.  I could verify the SQL query being executed and that part is working. 
  My guess is, that I can not use the $result as I am doing it.
  I always get a "not found".</p>
  
  <pre><code>$command = ("SELECT * FROM '$table_name'" ." WHERE email = '$email'");
  $result = $db-&gt;query($command);
  
  
  if (!$result )
  
  {
  echo "not found";
  } 
  
  else {
  echo "found";
  }
  </code></pre>