Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to connect database in php

<?php
 $hostName = "localhost";
 $userName = "root";
 $password = "";
 $dbName = "database name";
 $conn= new mysqli($hostName,$userName,$password,$dbName);
 if($conn){
    echo "connected";
 }else{
    echo "not connected";
 }

  ?>
 
PREVIOUS NEXT
Tagged: #connect #database #php
ADD COMMENT
Topic
Name
5+1 =