Last active
September 6, 2018 13:19
-
-
Save syntaxhacker/ca7d4a886a23604fe4b5e8b21d225f48 to your computer and use it in GitHub Desktop.
c9 MYSQL
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 | |
| $servername = getenv('IP'); | |
| $username = getenv('C9_USER'); | |
| $password = "welcome"; //db pass | |
| $database = "c9"; //db name | |
| $dbport = 3306; | |
| // Create connection | |
| $db = new mysqli($servername, $username, $password, $database, $dbport); | |
| // Check connection | |
| if ($db->connect_error) { | |
| die("Connection failed: " . $db->connect_error); | |
| } | |
| echo "Connected successfully (".$db->host_info.")"; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment