Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $db_name = "foo";
- $connection = @mysql_connect("myserver", "myuser", "mypw") or die("Could not connect to database");
- mysql_select_db($db_name, $connection) or die("Count not select database");
- // 1st (uncomment and add config):
- include_path = "C:phpincludes"
- // <2nd (uncomment):
- extension_dir = "ext"
- // 3rd (uncomment and edit config):
- extension=C:/PHP/ext/php_mysql.dll
- extension=C:/PHP/ext/php_mysqli.dll
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- // Create connection
- $conn = new mysqli($servername, $username, $password);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement