php conect to sql code example
Example: database connectivity in php
<?php
///////////neha jaiswal/////
/////set variable/////////
$serve="localhost";
$user="root";
$password="";
$db="cart_system";///database name
///create connection with db////
$conn=mysqli_connect($serve,$user,$password,$db);
////check condition for connection fail or not
if ($conn) {
echo "connection success";
}else
{echo "connection unsuccess";
}
?>