This stems from the previous line:
$query = mysql_query("SELECT * FROM archive");
Since you are working with a procedural API, you (should) pass in the MySQL connection resource that you want to perform the query on.
Because a) you did not pass in the connection resource OR b) the query itself failed, mysql_query
just returned FALSE
, hence the error message:
mysql_fetch_array() expects parameter 1 to be resource, boolean given
Change the above to this and you should be all set assuming $db
is the return value of mysql_connect
:
$query = "SELECT * FROM archive";
$result = mysql_query($query, $db);
if(!$query) {
trigger_error(mysql_error()." in ".$query);
}