Jump to content

[SOLVED] Can't understand why... (WHILE LOOP)


Recommended Posts

Hello everyone

This is my first post, I'm kind of a php/mysql newbie so i would appreciate any help

 

Here's my simple code:

 

<?php

		$con = mysql_connect("localhost","inteoria_crash","****");

		if (!$con)
			{
			die ('Could not connect.'.mysql_error());
			}

		mysql_select_db ("inteoria_vera",$con) or die(mysql_error());

		$result=mysql_query("SELECT * FROM tblNews");


		$row=mysql_fetch_array($result);


		echo "<ul>";

		while ($row=mysql_fetch_array($result))

			{
			echo "<li><span class='bold'>".$row['date']."</span>: ".$row['content']."</li>";
			}
		echo "</ul>";

		mysql_close($con);
		?>

 

Now, my question is: If I have four records in my DB:

 

http://img353.imageshack.us/my.php?image=picture2wv0.png

 

Why the hell do I only get to see 3?

 

http://img151.imageshack.us/my.php?image=picture3xr1.png

 

Link to comment
https://forums.phpfreaks.com/topic/130054-solved-cant-understand-why-while-loop/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.