title: my sql query failing and yet returns no mySQL errors
body: <p>I have been writing php and mySQL functions all day and as I was writing the simplest part of my project I have hit a wall.</p>
  
  <p>The function should simply count how many entries are in the database and return that number (If there is a more simple way please let me know, this is my first php + mysql project)</p>
  
  <p>Here is the code:</p>
  
  <pre><code>function quoteCount(){
      global $db;
      $totalQuoteNum = array();
      $query = "SELECT * FROM Quotes";
      $result_set = mysqli_query($db, $query)
      or die ("Query $query failed ".mysqli_error($db)); //fails here
      $totalQuoteNum = mysql_num_rows($result_set) 
      or die ('couldnt count rows'.mysqli_error($db));
      echo 'COUNTED EVERYTHING!!!';
      return $totalQuoteNum;
  };
  </code></pre>
  
  <p>Now when the die statement prints I get the string but not the mysqli error.</p>
  
  <p>Things I have tried and ruled out:</p>
  
  <ol>
  <li>$db is correct</li>
  <li>query works in mysql</li>
  <li>I wasnt sure if the database was connected, so I added the connect inside this function and stil nothing.</li>
  </ol>
  
  <p>Any ideas? From what I see it should work and its not giving me any error to work from. Please help!</p>