title: PHP mysql error: "mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in"
body: <p>First of all let me say I have looked around and found similar posts like this but none of them are helping me so this is why I am asking you help.</p>
  
  <p>Using PHP, I am trying to execute two SQL queries. First query does a <code>Select</code> statement with <code>INNER JOIN</code>, the other does a normal <code>select</code> statement. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>$conn = mysql_connect(DBHOST,DBUSER,DBPASS);
  
  mysql_select_db(DBNAME);
  $result = mysql_query("
        SELECT a.`role` AS 'role'
        FROM authme
        INNER JOIN a
        ON `authme`.`username` = `a`.`username`
        WHERE `authme`.`username` = 'vidhu';
  ", $conn); 
  echo mysql_result($result, 0) . "&lt;br /&gt;";
  
  mysql_select_db(DBNAME);
  $result = mysql_query("SELECT `email` FROM `authme` WHERE `username` = 'vidhu'", $conn); 
  echo mysql_result($result, 0) . "&lt;br /&gt;";
  </code></pre>
  
  <p>So when I execute this page is what I get:</p>
  
  <pre><code>Admin   &lt;--- Result from first query
  
  Warning: mysql_result() expects parameter 1 to be resource, boolean given in    C:\Apache24\htdocs\test.php on line 12  &lt;---- second query
  </code></pre>
  
  <p>Executing both queries individually, works fine, but when both are combined I get that error. Any ideas?</p>
  
  <p>Thanks for your time to read this!
  Vidhu</p>