title: mysql_error() not displaying an error
body: <p>I am trying to debug my code but mysql_error() isn't displaying anything. I know there is something wrong, because when I write </p>
  
  <pre><code>or die("ERROR");
  </code></pre>
  
  <p>It displays ERROR. So the problem must be with that line of code. When I write</p>
  
  <pre><code>or die(mysql_error());
  </code></pre>
  
  <p>It shows up blank. Here is my code for the line that I think has the error:</p>
  
  <pre><code>while ($rows = mysql_fetch_array($sql6) or die(mysql_error())) {
  </code></pre>
  
  <p>Now here is the full code block:</p>
  
  <pre><code>$sql6 = mysql_query("SELECT * FROM replies WHERE thread_id = $thread_id");
      $numRows = mysql_num_rows($sql6);
      $replies = '';
      if ($numRows &lt; 1) {
          $replies =  "There are no replies yet, you can make the first!";
      } else {
          while ($rows = mysql_fetch_array($sql6) or die(mysql_error())) {
              $reply_content = $rows['5'];
              $reply_username = $rows['7'];
              $reply_date = $rows['8'];
              $reply_author_id = $rows['4'];
  
              $sql9 = mysql_query("SELECT * FROM users WHERE id = '$reply_author_id'");
              $numRows = mysql_num_rows($sql9); 
              if ($numRows &lt; 1) {
                  while ($rows = mysql_fetch_array($sql9)) {
                      $reply_user_fn = $rows['first_name'];
                      $reply_user_ln = $rows['last_name'];
                      $reply_user_id = $rows['id'];
                      $reply_user_pp = $rows['profile_pic'];
                      $reply_user_lvl = $rows['user_level'];
                      $reply_user_threads = $rows['threads'];
                      $reply_user_email = $rows['email'];
  
                      $replies .= '&lt;tr&gt;&lt;td valign="top" style="border: 1px solid black;"&gt;';
                      $replies .= '&lt;div class="reply" style="min-height: 125px;"';
                      $replies .= '&lt;h2&gt;Re: ' . $thread_title . '&lt;/h2&gt;&lt;br /&gt;';
                      $replies .= '&lt;em&gt;by: ' . $reply_username . ' - ' . $reply_date . '&lt;/em&gt;&lt;hr /&gt;';
                      $replies .= $reply_content;
                      $replies .= '&lt;/div&gt;&lt;/td&gt;';
                      $replies .= '&lt;td valign="top" width="200" align="center" style="border: 1px solid black;"';
                      $replies .= '&lt;img src="userdata/profile_pics/' . $reply_user_pp . '" width="80" height="80"&gt;&lt;br /&gt;';
                      $replies .= '&lt;a href="profile.php?u=' .$reply_username . '" style="color: black;"&gt;'. $reply_username .'&lt;/a&gt;&lt;br /&gt;';
                      $replies .= '&lt;a href="profile.php?u=' .$reply_username . '" style="color: black;"&gt;' . $reply_user_fn.' ' .$reply_user_ln . '&lt;/a&gt;&lt;br /&gt;';
                      $replies .= 'Threads: ' . $reply_user_threads . ' &lt;br /&gt;Level: '. $reply_user_lvl .'&lt;br /&gt;Sign up date: ' . $reply_user_email/*PUT SIGNUP DATE*/ .'';
                      $replies .= '&lt;input type="button" name="addfriend" value="Add Friend"&gt;';
                      $replies .= '&lt;/td&gt;';
                      }
                  }
              }
          }
  </code></pre>
  
  <p>What am I doing wrong and why won't PHP display the mysql error?
  Thanks</p>