Connect MySql database using PHP Language
<?php
$servername = "localhost";
$username = "username"; // when you work in your computer then use username name "root"
$password = "password"; // when you work in your computer then use password Empty
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
Quick ask your Question
- Connect mysql database using php Language
- Insert record into MySQL Database Using PHP Language
- Get Record from MySQL Database in PHP
- Update Record from MySQL Database in PHP
- Delete Record From a MySQL Database using PHP
- Insert Multiple Records into MySQL with a Single Query
- Create MySQL Database Using PHP
- Create Table in MySQL Database Using PHP