Advertisement
Guest User

Untitled

a guest
May 7th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php
  2. // A simple PHP script demonstrating how to connect to MySQL.
  3. // Press the 'Run' button on the top to start the web server,
  4. // then click the URL that is emitted to the Output tab of the console.
  5.  
  6. $servername = getenv('IP');
  7. $username = getenv('C9_USER');
  8. $password = "";
  9. $database = "c9";
  10. $dbport = 3306;
  11.  
  12. // Create connection
  13. $db = new mysqli($servername, $username, $password, $database, $dbport);
  14.  
  15. // Check connection
  16. if ($db->connect_error) {
  17. die("Connection failed: " . $db->connect_error);
  18. }
  19. #echo "Connected successfully (".$db->host_info.")";
  20.  
  21. $con=$db;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement