Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. $db_name = "foo";
  2. $connection = @mysql_connect("myserver", "myuser", "mypw") or die("Could not connect to database");
  3. mysql_select_db($db_name, $connection) or die("Count not select database");
  4.  
  5. // 1st (uncomment and add config):
  6. include_path = "C:phpincludes"
  7.  
  8. // <2nd (uncomment):
  9. extension_dir = "ext"
  10.  
  11. // 3rd (uncomment and edit config):
  12. extension=C:/PHP/ext/php_mysql.dll
  13. extension=C:/PHP/ext/php_mysqli.dll
  14.  
  15. <?php
  16. $servername = "localhost";
  17. $username = "root";
  18. $password = "";
  19.  
  20. // Create connection
  21. $conn = new mysqli($servername, $username, $password);
  22.  
  23. // Check connection
  24. if ($conn->connect_error) {
  25. die("Connection failed: " . $conn->connect_error);
  26. }
  27. echo "Connected successfully";
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement