make database connection in php

To make database connection in php
make a new php file and copy that code there


<?php
$con = mysql_connect("hostname","username","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

?>

 

Comments