Echoing table contents I'm working on an exercise where I"m supposed to display all data contained in a table.  Here's the solution I can up with:

&lt;?php
$result = mysql_query("SELECT * FROM contacts ORDER BY id DESC");
    while($user= mysql_fetch_array($result)) {
        echo $user['first'] . " " . $user['last'] . "&lt;br /&gt;" . $user[phone] . "br /&gt;";
    }
?&gt;


Here's the solution the tutorial gave:

&lt;?php 
$result=mysql_query("SELECT * FROM contacts ORDER BY id DESC");

$num=mysql_num_rows($result); 

$i=0;
while ($i &lt; $num) {

$first=mysql_result($result,$i,"first");
$last=mysql_result($result,$i,"last");
$phone=mysql_result($result,$i,"phone");


echo "&lt;b&gt;$first $last&lt;/b&gt;&lt;br&gt;Phone: $phone&lt;br&gt;&lt;hr&gt;&lt;br&gt;";

$i++;
}
?&gt;


The database fields are:

id
first
last
phone


Can someone explain WHY one is better than the other. They both work as far as I can tell.
Yours is better.  Both are bad.
Don't use either of them
The mysql_* functions aren't a good way to learn how to interact with databases.  It is a shame that there are still tutorials teaching how to interact with databases using these functions.  Here is a snippet that explains more about why you shouldn't use those functions and what you can use instead:

Please, don't use mysql_* functions in new code. They are no longer maintained and the deprecation process has begun on it. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.Snippet Source

Minor Comments
You missed quotes around phone.
In pure PHP don't use an end tag ?&gt;.  It can cause output if you have blank lines after it causing headers to be sent prematurely (see this).