This has been on my mind...

I have always used this (for the most part) to select data in a DB...

$connection = mysql_connect($hostname, $user, $pass) or die ("Unable to connect!");
$query = "SELECT * from $table.......";
$result = mysql_db_query($database, $query, $connection) or die ("Could not execute query: $query. " . mysql_error());
while(list($id, $name, $address, $city,.......) = mysql_fetch_row($result))
 // display data
Now, if I only want to SELECT one row of data (ie. WHERE id='123') is the above still efficient (or 'good coding') to use? If not, what is the better method.