I am making a mysql query that gathers comments for a user, it works properly, I connect to the database and recieve the comments for a user, but it is not showing the first comment for the user. Here is the code
function comments(){
//connect to db
connect_db_members();
//start query
global $number;
$query = "SELECT * FROM comments WHERE commentie='$number' ORDER BY id DESC";
//run query
$results = mysql_query($query);
//check if there are no comments
if(mysql_fetch_array($results) == ""){
echo '<div class="comments_about_wrapper">
<div class="comment_text_wrapper">
<div class="comment_text" ><p style="font-size:29px;">You have no comments</p>
</div>
</div>
</div>';
}
else {while($row = mysql_fetch_array($results)){
echo '<div class="comments_about_wrapper">
<div class="comment_text_wrapper">
<div class="comment_text"><p>';
echo nl2br($row['comment']);
echo ' </p>
</div>
</div>
<div class="comments_about_small_box_wrapper">
<div class="comments_about_picture">
<a href=""><img src="" width="45px" height="45px"></a>
</div>
</div>
</div>';
}
}
This is the table comments
id commenter commentie time comment
5 5 123456 0 EXAMPLE HELLO
6 2 123456 0 EXAMPLE GOODBYE
It will display EXAMPLE GOODBYE but not EXAMPLE HELLO.