$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."
"); mysql_select_db($dbname); $sql = "select * from links"; $query = mysql_query($sql); if (mysql_num_rows($query)) { //moved the table header up here, out of the loop so that it only executes once //everything else below will all be part of the same table print ''; print ''; while ($row = mysql_fetch_array($query)) { $url = $row['url']; $description = $row['description']; echo $check = count($row); print ''; print ''; print ''; print ''; } } //moved the table end tag out of the loop for the same reason as above print '
URLDescription
'; print $url; print ''; print $description; print '
';