Hello. Thanx for look. This is for me unbelievable...
I want display all names beginning with letter "A"
(There is 9 names beginning with A in my database)
- when I run SQL query on server, it show proper list of names - 9
SELECT name FROM database WHERE name LIKE 'A%'
- when I check mysql_fetch_row() from my php code, if shows real number - 9
BUT!!!
when I run this code, it shows only 8 names and does not show the first one.
$result = mysql_query("SELECT name FROM database WHERE name LIKE 'A%' ");
$row = mysql_fetch_row($result);
echo mysql_num_rows($result)."<br>";
// Shows number 9
WHILE ($row = mysql_fetch_row($result))
{
echo $row[0]."<br>";
}
// List only 8 names and does not list the first one
Please, what's wrong? I found this simple code recommended in all examples on the internet...