<?php header('Content-Type:text/html;charset=gbk');//1解决数据库中乱码问题 $servername="127.0.0.1";
这是我的代码,为什么会出现这么多的问题,快帮我解决一下吧!~下面是错误提示:浏览首页总累积次数:Warning:mysql_fetch_object():supplied...
这是我的代码,为什么会出现这么多的问题,快帮我解决一下吧!~
下面是错误提示:
浏览首页总累积次数:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 21
日期:07月08日星期五
Notice: Use of undefined constant m - assumed 'm' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant d - assumed 'd' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant Y - assumed 'Y' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant m - assumed 'm' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Use of undefined constant d - assumed 'd' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Use of undefined constant Y - assumed 'Y' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Undefined variable: mlink in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 38
Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 38
浏览首页累积次数:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 40
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 49
浏览总人数:
--------------------------------------------------------------------------------
IP位址 最近时间 次数 用户资讯
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 58
--------------------------------------------------------------------------------
日期:07月07日星期四
Notice: Use of undefined constant m - assumed 'm' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant d - assumed 'd' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant Y - assumed 'Y' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant m - assumed 'm' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Use of undefined constant d - assumed 'd' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Use of undefined constant Y - assumed 'Y' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Undefined variable: mlink in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 38
Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 38
浏览首页累积次数:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 40
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 49
浏览总人数:
--------------------------------------------------------------------------------
IP位址 最近时间 次数 用户资讯 展开
下面是错误提示:
浏览首页总累积次数:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 21
日期:07月08日星期五
Notice: Use of undefined constant m - assumed 'm' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant d - assumed 'd' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant Y - assumed 'Y' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant m - assumed 'm' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Use of undefined constant d - assumed 'd' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Use of undefined constant Y - assumed 'Y' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Undefined variable: mlink in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 38
Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 38
浏览首页累积次数:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 40
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 49
浏览总人数:
--------------------------------------------------------------------------------
IP位址 最近时间 次数 用户资讯
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 58
--------------------------------------------------------------------------------
日期:07月07日星期四
Notice: Use of undefined constant m - assumed 'm' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant d - assumed 'd' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant Y - assumed 'Y' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 33
Notice: Use of undefined constant m - assumed 'm' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Use of undefined constant d - assumed 'd' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Use of undefined constant Y - assumed 'Y' in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 34
Notice: Undefined variable: mlink in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 38
Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 38
浏览首页累积次数:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 40
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\PHPnow-1.5.6\htdocs\mysite\1.php on line 49
浏览总人数:
--------------------------------------------------------------------------------
IP位址 最近时间 次数 用户资讯 展开
展开全部
贴出完整代码这个是你数据库的问题,你可能没有与mysql的连接句柄,而直接调用了数据库的连接
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
mysql_select_db()后加一行
mysql_query("set names gbk")
然后以gbk编码方式编辑脚本
mysql_query("set names gbk")
然后以gbk编码方式编辑脚本
追问
还是一样的错误
追答
网页代码贴出来看看。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
数据库编码 表编码 环境默认编码 统一设置就不会出现这个问题了
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询