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)  
{$row['name']} {$row['type']} {$row['size']} Download
'; } // Free the result $result->free(); } else { echo 'Error! SQL query failed:'; echo "
{$dbLink->error}
"; } // Close the mysql connection $dbLink->close(); ?>