In while loop
while( $data=mysql_fetch_array($result))
{
echo $data[0].$data[1].$data[2].$data[3]
}
what it does? It just looping through the $result.So it give you the result as row1 row2 .....
But when you echo it with out the while loop it prints the first row .And echo it again it will give you the second row.
The idea in while loop is every time it fetches the row, adds it to array and echo for you automatically.
But without while the idea is you are manually echo every row.
@:- $data =mysql_fetch_array($result);
Using this line of code for the second time does not work as the result set is same.
If you change (while using second time)
$data =mysql_fetch_array($result);
to
while( $data=mysql_fetch_array($result))
{
echo $data[0].$data[1].$data[2].$data[3]
}
it will print from the second row to last row.
Thanks
Debasis