before going through this practical make sure you have mysql server installed on your system click here for list of offline servers and downloads
after installation you can now start writing the code below
note: your file should be saved using .php as the extension
<?php
$servername = "localhost";
$username = "username";
$password = "password";
// Create connection$conn = new mysqli($servername, $username, $password);
// Check connectionif ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
username and password are different depending on the server you installed.
0 comments:
Post a Comment