PHP COURSE • LESSON 42
PHP MySQL Database Connection
PHP can connect with MySQL databases to store and manage data.
db.php
<?php
$connection = mysqli_connect(
"localhost",
"root",
"",
"database"
);
if(!$connection){
die("Connection Failed");
}
echo "Connected";
?>
Common Database Uses
Users, posts, products, payments and dashboards.