Skip to content

Instantly share code, notes, and snippets.

Created March 10, 2017 18:10
Show Gist options
  • Save anonymous/c9810ed9badba60347979b9cb55295de to your computer and use it in GitHub Desktop.
Save anonymous/c9810ed9badba60347979b9cb55295de to your computer and use it in GitHub Desktop.
Config.php
<?php
DEFINE("DB_HOST","localhost");
DEFINE("DB_USER","ricky");
DEFINE("DB_PASS","is_a_douche");
DEFINE("DB_NAME","rekt");
?>
<?php
//config file is not included in public repo for security reasons
require_once('config.php');
//CREATE A CONNECTION TO SQL
$mysqli = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment