Re-fixed function.php with mysqli functions and new db names