database connection file in php

this code use only local server

 <?php $conn = mysqli_connect('localhost','root','','tablename');?>
HTML

 

 

This live server for used.

 <?php $connection = mysqli_connect('localhost','database user','database password','tablename');?>
HTML
This databse connection file any file in include for this code
 <?php
require_once('connection.php');
?>
HTML
OR

This databse connection file any file in include for this code

<?php include("connection.php"); ?>  
HTML

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *