Hi everyone and thanks for reading. This problems been driving me nuts for the last day and I'm completely stuck. I made a dummy table of users to test out SQL connections but everytime I echo out the information, it keeps dropping the first record, and jumps straight to record two onwards. If I sort the query using ORDER BY 'id' desc, then it will drop the last record and start on the one before the last; any ideas whats gone wrong?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP: Alternate Table Row Colours</title>
</head>
<body>
<?
$connection = mysql_connect("mysql.thepianoman.info", "****", "*****");
$database_select = mysql_select_db("mytests", $connection);
$result = mysql_query("SELECT * FROM members", $connection);
$row = mysql_fetch_array($result);
while ($row = mysql_fetch_array($result)) {
echo $row["id"];
echo $row["firstname"];
echo $row["lastname"];
echo $row["username"];
echo $row["password"];
echo $row["email"];
}
?>
</body>
</html>
<?
mysql_close($connection);
?>
Thanks,
Anthony