query($sql); // Check if it was successfull if($result) { // Make sure there are some files in there if($result->num_rows == 0) { echo '

There are no files in the database

'; } else { // Print the top of a table echo ''; // Print each file while($row = $result->fetch_assoc()) { echo " "; } // Close table echo '
Name Mime Size (bytes) Created  
{$row['name']} {$row['mime']} {$row['size']} {$row['created']} Download
'; } // Free the result $result->free(); } else { echo 'Error! SQL query failed:'; echo "
{$dbLink->error}
"; } // Close the mysql connection $dbLink->close(); ?>