代码改变世界

php连接mysql

2014-04-27 14:08  陈健红  阅读(107)  评论(0)    收藏  举报

 

在php里写

$conn=@mysql_connect("localhost","root(用户名)","root(密码)")or die("数据库连接失败");

mysql_select_db("test");

mysql_query("set names 'utf-8");