Home php教程 php手册 PHP开发中的错误收集,不定期更新。

PHP开发中的错误收集,不定期更新。

Jun 21, 2016 am 08:55 AM
array error file mysqli warning

Fatal error: Non-static method Conn::__construct() cannot be called statically in /file.php

没有静态的方法(里面这个指方法参数,字符串类型),不能从静态上下文引用。

Fatal error: [] operator not supported for strings in /file.php

当一个变量已设为非数组类型的时候,就不能再次使用[]让同名变量增加数据键值
解决方法:1.改变变量名称、2.使用$var = array(...)
举例:

复制代码 代码如下:


//这里为字符串类型
$err = $e->getMessage();

//当执行到这里的时候会报错
$err[] = array
(
'gid' => $this->_get['id'],
'url' => $new,
'log' => $err,
'time' => time()
);


Fatal error: Declaration of Listing::content() must be compatible with that of InewsList::content() in file\List_1.php on line 7

统一接口所有类方法都必须和接口规定的一致:作用域声明、方法名、参数数量

Warning: mysqli::query() [mysqli.query]: Couldn't fetch Insert in /file.php

必须使用mysqli链接数据库后返回的结果集去执行操作。

Warning: 1064_You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near...

网上搜索是MYSQL兼容问题,实际操作上是语法错误,需检查SQL语句写的是否正确。

Warning: array_shift() expects parameter 1 to be array, integer given

函数第一个参数必须是一个数组。

#1366 - Incorrect integer value: '' for column 'ID' at row 1

mysql版本为msyql 5.1.14 WIN32版本,出现错误的原因是没有给自增ID赋值,尽管之前的版本可以不赋值,自动增加,但是在新版本的msyql中需要为其赋值NULL

#1136:Column count doesn't match value count at row 1

检查一下有没有序号自增加的字段。
所存储的数据与数据库表的字段类型定义不相匹配.
字段类型是否正确, 是否越界, 有无把一种类型的数据存储到另一种数据类型中.

#1062_Duplicate entry '...' for key 'map'

关键字重复、可能是主键ID、也可能是唯一字段。



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if 'Uncaught (in promise) Error: Request failed with status code 500' occurs when using axios in a Vue application? What should I do if 'Uncaught (in promise) Error: Request failed with status code 500' occurs when using axios in a Vue application? Jun 24, 2023 pm 05:33 PM

It is very common to use axios in Vue applications. axios is a Promise-based HTTP client that can be used in browsers and Node.js. During the development process, the error message "Uncaught(inpromise)Error: Requestfailedwithstatuscode500" sometimes appears. For developers, this error message may be difficult to understand and solve. This article will explore this

Use java's File.length() function to get the size of the file Use java's File.length() function to get the size of the file Jul 24, 2023 am 08:36 AM

Use Java's File.length() function to get the size of a file. File size is a very common requirement when dealing with file operations. Java provides a very convenient way to get the size of a file, that is, using the length() method of the File class. . This article will introduce how to use this method to get the size of a file and give corresponding code examples. First, we need to create a File object to represent the file we want to get the size of. Here is how to create a File object: Filef

Hongmeng native application random poetry Hongmeng native application random poetry Feb 19, 2024 pm 01:36 PM

To learn more about open source, please visit: 51CTO Hongmeng Developer Community https://ost.51cto.com Running environment DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. To create an application, click File- >newFile->CreateProgect. Select template: [OpenHarmony] EmptyAbility: Fill in the project name, shici, application package name com.nut.shici, and application storage location XXX (no Chinese, special characters, or spaces). CompileSDK10, Model: Stage. Device

Solve the problem of 'error: incomplete type is not allowed' in C++ code Solve the problem of 'error: incomplete type is not allowed' in C++ code Aug 26, 2023 pm 08:54 PM

Solve the "error:incompletetypeisnotallowed" problem in C++ code. During the C++ programming process, you sometimes encounter some compilation errors. One of the common errors is "error:incompletetypeisnotallowed". This error is usually caused by operating on an incomplete type. This article will explain the cause of this error and provide several solutions. firstly, I

Solve the 'error: expected initializer before 'datatype'' problem in C++ code Solve the 'error: expected initializer before 'datatype'' problem in C++ code Aug 25, 2023 pm 01:24 PM

Solve the "error:expectedinitializerbefore'datatype'" problem in C++ code. In C++ programming, sometimes we encounter some compilation errors when writing code. One of the common errors is "error:expectedinitializerbefore'datatype'". This error usually occurs in a variable declaration or function definition and may cause the program to fail to compile correctly or

PHP Warning: Invalid argument supplied for foreach() - Solution PHP Warning: Invalid argument supplied for foreach() - Solution Aug 26, 2023 pm 09:42 PM

PHPWarning:Invalidargumentsuppliedforforeach()-Solution When developing web pages or applications using PHP, you often encounter various errors and warnings. One of the common warnings is "Invalidargumentsuppliedforforeach()", which is usually produced when using a foreach loop to iterate over an array. This question seems simple, but if you don't

How to solve PHP Warning: fopen(): SSL operation failed in file.php on line X How to solve PHP Warning: fopen(): SSL operation failed in file.php on line X Aug 25, 2023 am 09:22 AM

How to solve PHPWarning:fopen():SSLoperationfailedinfile.phponlineX In PHP programming, we often use the fopen function to open files or URLs and perform related operations. However, when using the fopen function, sometimes you will encounter something similar to Warning:fopen():SSLoperationfailedinfile.p

Rename files using java's File.renameTo() function Rename files using java's File.renameTo() function Jul 25, 2023 pm 03:45 PM

Use Java's File.renameTo() function to rename files. In Java programming, we often need to rename files. Java provides the File class to handle file operations, and its renameTo() function can easily rename files. This article will introduce how to use Java's File.renameTo() function to rename files and provide corresponding code examples. The File.renameTo() function is a method of the File class.

See all articles