<?php mysql_connect("localhost","root","");//连接数据库,root是用户名,密码为空。 mysql_select_db("databasename");//选择数据库 ?>