One line Database connection in PHP here is the example kindly find it below-
Create connection page and include all pages where Database connection required-
<?php include 'connection.php'; ?>
connection.php
<?php
$link = new mysqli("localhost", "username", "password", "Db_name", "3306");
if($link->connect_errno)
{
print "error";
}
?>
So lets Enjoy and get like this update keep in touch with us- Thanking You.
Report