Advertisement
Guest User

Untitled

a guest
Jan 15th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $servername = "localhost";
  5. $username = "lopik1484497160";
  6. $password = "Muv660Kv";
  7.  
  8. // Create connection
  9. $conn = new mysqli($servername, $username, $password);
  10.  
  11. // Check connection
  12. if ($conn->connect_error) {
  13. die("Connection failed: " . $conn->connect_error);
  14. }
  15. echo "Connected successfully";
  16.  
  17.  
  18. // this will avoid mysql_connect() deprecation error.
  19. error_reporting( ~E_DEPRECATED & ~E_NOTICE );
  20. // but I strongly suggest you to use PDO or MySQLi.
  21.  
  22. define('DBHOST', 'localhost');
  23. define('DBUSER', 'lopik1484497160');
  24. define('DBPASS', 'Muv660Kv');
  25. define('DBNAME', 'lopik1484497160');
  26.  
  27. $conn = mysql_connect(DBHOST,DBUSER,DBPASS);
  28. $dbcon = mysql_select_db(DBNAME);
  29.  
  30. if ( !$conn ) {
  31. die("Connection failed : " . mysql_error());
  32. }
  33.  
  34. if ( !$dbcon ) {
  35. die("Database Connection failed : " . mysql_error());
  36. }
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement