Created
April 1, 2016 08:28
-
-
Save ianjuma/28d997763a26271e6e9d872e442f545c to your computer and use it in GitHub Desktop.
Connect to DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//This allows you to connect to your DB | |
//connection credentials | |
$servername = getenv("IP"); | |
$username = getenv("C9_USER"); | |
$password = ""; | |
$database = "lakehub"; | |
$dbport = 3306; | |
//Connect to DB | |
$db = new mysqli($servername, $username, $password, $database,$dbport); | |
//Call | |
if($db->connect_error){ | |
header('content-type: text/plain'); | |
die("error encountered."); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment