connect_error) { echo 4004; // Unsuccessful connection to database } } else { // Connection variables not set echo 4005; // Respond with bad-request code } return $conn; } /* Closes the connection to the database */ function db_close($conn) { $conn->close(); } ?>