$link=mysql_connect("localhost","user","passwd") or die("连接数据库错误!");这样就可以避免Warning的信息,也可以显示你自定义的出错信息!