Skip to content

Instantly share code, notes, and snippets.

@dpmckenzie
Created October 20, 2012 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpmckenzie/3924169 to your computer and use it in GitHub Desktop.
Save dpmckenzie/3924169 to your computer and use it in GitHub Desktop.
File for opening a database
<?php
$mysqli = new mysqli('[address of database]', '[username]', '[password]', '[database name]');
// check connection
if (mysqli_connect_errno()) {
exit('Connect failed: '. mysqli_connect_error());
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment