i recommend u use sumthing better, shorter and more suitable than $query_data, maybe sumthin like "$row", becoz what ur doing here, is fetching the field names from a database in order for you to retreive further records. Your forming an array with this name you set. Also; make sure you have actually set a valid $result and $query, as they all link up, if theres an error in any 1 of those lines, ur error will be said to be on the line of you while statement.
eg:
<?php
$query = "SELECT * FROM $database";
// before anything else, u could also test and make sure that your SQL statement has actually worked (this is for good practice, a little bit off topic)...
if ($query)
{
$result = mysql_db_query($dbname);
while ($row = mysql_fetch_array($result))
{
$field1 = "$row[Field_1]";
$field2 = "$row[Field_2]"; // etc etc
}
// any other html (tables, font, links etc)
// when you wish to use the data you retreived, print the $field1 or $field 2
}
else
{
print "Query failed: ".mysql_error(); // this shows where the line is incase you didnt know :-)
?>
Hope this helps, theres a few "extra" bits there which are a lil bit off topic IE: mysql_error(); - but hey, if u want a good and effecient result no matter what output you get, its best you take note of these kinda things! Good luck :-)