$dbhost="host";
$dbuser="username";
$dbpass="password";
$dbname="database name";
$table="table name";
mysql_connect( "$dbhost", "$dbuser", "$dbpass") or die( "Unable to connect
to SQL server");
@mysql_select_db( "$dbname") or die( "Unable to select database");
if(!IsSet($sort)) $result = mysql_query( "select * from $table");
else $result = mysql_query( "select * from $table order by $sort");
?>
while ($field=mysql_fetch_field($result)) {
echo "name\">$field-
>name ";
}
echo " ";
while($row = mysql_fetch_row($result)) {
echo "";
for($i=0; $i < mysql_num_fields($result); $i++) {
echo "$row[$i] ";
}
echo " \n";
}
echo "
";
?>