two things... First, the mysql_fetch_array() function returns a single row of results as an associative array. In other words, it is only fetching one table name. Also, if your current while() clause evaluates the value of your array to false, it will end your loop. Here's the code you are looking for:
$list = mysql_list_tables($database);
while($result = mysql_fetch_array($list)) {
echo "$result[0]";
}
by the way, you might have meant to use $result earlier... such as follows:
$result = mysql_list_tables($database);
while($array = mysql_fetch_array($result)) {
echo "$array[0]";
}
This is less confusing, to me at least.