SHARE
TWEET

Untitled

a guest Jun 17th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top