PHP unlimited classification configuration connection file

Configure connection file

New file conn.php

<?php
    $db_host='localhost';
    $db_user='root';
    $db_password = '';
    $db_name = '';
    $link=@mysql_connect($db_host,$db_user,$db_password)or die(mysql_error());
    mysql_select_db($db_name,$link)or die(mysql_error());
    mysql_query("set names utf8;")or die('编码设置错误');
?>

$db_password = ''; fill in the database connection password, $db_name = ''; fill in the name of the database.

When using the database file later, you only need to call conn.php.

Continuing Learning
||
1
2
3
4
5
6
7
8
9
<?php
$db_host='localhost';
$db_user='root';
$db_password = '';
$db_name = '';
$link=@mysql_connect($db_host,$db_user,$db_password)or die(mysql_error());
mysql_select_db($db_name,$link)or die(mysql_error());
mysql_query("set names utf8;")or die('');
?>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
submitReset Code
图片放大关闭