Docstoc

PHP Mysql connection

Document Sample
PHP Mysql connection Powered By Docstoc
					<?php
/*
Author: Muhammad Ahsan Khan
  Software Engineer
  Web Developer
  anelway120@hotmail.com
  anelway120@yahoo.com
  +1(203)3403607
*/
echo("PHP and MySQL simple connection <br>" );// <br> use for line change

$host = "localhost"; //If you want to live then used www.your-website-name.com
            //Its need web hosting

$db_user = "root"; // Initializa it by Data base user-name and I'm using grant dba
$db_passward = ""; //By default the mySql root dba passward is null

$connection = mysql_connect($host, $db_user, $db_passward);
//above statement is making connection from mysql with root user on your local machine

// check this connection now

  if(!$connection)
  {
     echo "Connection not Established" . mysql_error();
  }
  else
  {
    echo "Connection Established";
  }

?>

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:93
posted:3/19/2010
language:English
pages:1
Description: Simple connection statement where you can connect PHP and mySQL database.