Skip to content

Instantly share code, notes, and snippets.

@seanwalsh
Created August 31, 2013 02:32
Show Gist options
  • Save seanwalsh/6395886 to your computer and use it in GitHub Desktop.
Save seanwalsh/6395886 to your computer and use it in GitHub Desktop.
<?php
// SERVER NAME
$serverName = $_SERVER['SERVER_NAME'];
$productionServer = "";
// SET DATABASE LOCAL/PRODUCTION
if ( $serverName == "localhost") {
$mysqli_host = "127.0.0.1";
$mysqli_user = "root";
$mysqli_pass = "";
$mysqli_db = "";
} else if ( $serverName = $productionServer ) {
$mysqli_host = "";
$mysqli_user = "";
$mysqli_pass = "";
$mysqli_db = "";
}
// CONNECT TO THE DATABASE
$mysqli_con = mysqli_connect( $mysqli_host, $mysqli_user, $mysqli_pass, $mysqli_db );
// CHECK THE DATABASE CONNECTION
if ( mysqli_connect_errno ( $mysqli_con ) ) {
echo "Failed to connect to the database: " . mysqli_connect_error();
}
@realneo
Copy link

realneo commented Aug 30, 2014

Hey,

Line 13: Theres a problem.

its supposed to be double == instead of one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment