您好,欢迎访问一九零五行业门户网

php连接数据库,该如何解决

php连接数据库
/**************denglu.php****************/
我输入的账号的密码是对的,但是提示信息是乱码,我也不知道是登陆成功还是错误,提示窗口出现后,我点击确定,第二个警告错误才出现!!!!错误:
warning: mysql_fetch_assoc(): supplied argument is not a valid mysql result resource in f:\apache http server\appserv\www\classweb\denglu.php on line 15
warning: cannot modify header information - headers already sent by (output started at f:\apache http server\appserv\www\classweb\denglu.php:15) in f:\apache http server\appserv\www\classweb\denglu.php on line 24
------解决思路----------------------
$sql=select * from pre_common_member where username='$username';
------解决思路----------------------
弹窗乱码是因为你的程序文件不是 utf-8 的
错误信息是因为你在 
header('location:classweb.php'); 
前有输出
echo;
------解决思路----------------------
php连接数据库显示示例
//数据库连接conn.php页面
//功能页面显示数据
会员名:
密码:
maxlength=12>
移动电话:
maxlength=11>
邮箱地址:
maxlength=16 />
                                       (请填写正确的e-mail地址!)
qq号码:
maxlength=12 />
                                     (qq号只能由数字组成!)
性别:
maxlength=2>
maxlength=16>
其它类似信息

推荐信息