Mysql Database Connection in PHP

Mysql Database Connection in PHP
Posted Dec 18,2020 by Vipul Patel

1 Answer     547 Views    

<?php
	define('DB_SERVER', "localhost");
	define('DB_USER', "root");
	define('DB_PASS', "");
	define('DB_DATABASE', "Your Database Name");
	$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
?>


Elevenstech Dec 18, 2020

Yes, this is the correct way to connect database in PHP