Tìm kiếm với Google


Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Friday, February 22, 2008

Connect PHP and MySQL

Create file db_connect.php
db_connect.php content:
$host=localhost ;Mysql -server hostname
$user=root;// user privileges for mysql
$pass=password ;// User password
$port=3306;// Mysql port,common is 3306
mysql_connect($host,$user,$pass) or die ("could not connect to databases");
?>
And then,in other PHP file just add line
include("db_connect.php");