欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

PHP常见错误提示含义解释(实用!值得收藏)

程序员文章站 2023-12-19 11:42:58
本文讲述了php常见错误提示含义解释。分享给大家供大家参考,具体如下: 在学习php的时候,经常遇到各种错误提示,今天看到这错误提示和解释感觉挺好,现转过来,供我们学习。...

本文讲述了php常见错误提示含义解释。分享给大家供大家参考,具体如下:

在学习php的时候,经常遇到各种错误提示,今天看到这错误提示和解释感觉挺好,现转过来,供我们学习。呵呵。。。。。

1、notice: undefined variable:  变量名 in
注:使用了一个没有被定义的变量

2、parse error: syntax error, unexpected t_else in 
if () {
}else if () {
}
echo $test;
else {
}
注:是 if else if  else 句式错误

3、parse error: syntax error, unexpected $end in d
注:一般是大括号不匹配

4、parse error: syntax error, unexpected t_string in
注:一般是忘了写句末分号

5、warning: invalid argument supplied for foreach() in
注:foreach 的第一个参数必须是一个数组

6、warning: mysql_fetch_assoc(): supplied argument is not a valid mysql result resource in
注:这说明前面执行sql 返回失败,一般可能是sql语句 错误 ,如分析 不出来,刚可以打印出 mysql_error (); 看具体是哪个地方错了

7、no database selected
注:一般是没有连接数据库

8、 warning: mysql_connect() [function.mysql-connect]: access denied for user 'root'@'localhost' (using password: yes) in  …..   on line 3
access denied for user
'root'@'localhost' (using password: yes)
注:数据库用户名密码错

9、unknown database 'cms07261′
注:没有这个数据库

10、table 'cms0726.test' doesn't exist
注:表不存在

11、unknown column 'abc' in 'field list'
注:字段不存在

12、column count doesn't match value count at row 1
注:sql语句中 字段值的个数比字段名个数不一样

13、warning: wrong parameter count for 函数名 in 
注:函数对数个数 少了

14、fatal error: smarty error: [in message_list.html line 22]: syntax error: 'foreach: item' must be a variable name (literal string) 
注:看行号,说明 foreach 后面的item 后面必须跟一个变量名,不加$,是一个字符串(注:没有单双引)

15、fatal error: smarty error: [in message_list.html line 24]: syntax error: unrecognized tag: msg.message_id 
注:模板中 变量前缺少$

16、warning: smarty error: unable to read resource: "message_list1.html" in
注:模板文件找不到,看是否是文件名写错或文件存放到别的目录中去了。

17、fatal error: cannot redeclare get_sort1() (previously declared in
注:函数已经定义过,不能重新再定义

希望本文所述对大家php程序设计有所帮助。

上一篇:

下一篇: