This warning:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in output_fns.php on line 416
Is due to one or more of these:
Failed to connect to database server.
Failed to select database.
Failed to execute corresponding SQL statement.
Looking at the display_folders() function, it is clear that $result is an uninitialised local variable. As such, it has no corresponding SQL statement, so effectively you are trying to retrieve a result row on something that is not even a result set.
I would do something like this instead:
function display_folders()
{
$conn = db_connect();
$result = $conn->query("select first_name, last_name, email from user where username='$username'");
if(result) {
while ($row = mysql_fetch_array($result, MYSQL_NUM)) { // line 416
printf("Last Name: %s Last Name: %s Email: %s", $row[0], $row[1], $row[2]);
}
// ...
} else {
echo 'Nothing'; // or rather, more graceful error handling.
}
}
Of course, calling db_connect() from within a function may not be the best idea. You may want to pass it to the function instead, or maybe use a singleton (but I prefer passing).