PHP error Notice: Undefinedindex solution _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
PHP error Notice: Undefinedindex solution. I set error_reporting to E_ALL. when reading data, for example, $ row [name], many Notice: Undefinedindex: errors may occur. what should I do? Error_reporting (E_ALL ~ E_NOTICE) so I set error_reporting to E_ALL.

When reading data, for example, $ row ['name ']

There will be many Notice: Undefined index: errors,

What should I do? Error_reporting (E_ALL &~ E_NOTICE) is that true?

Undefined index: indicates the error in your code: "variables are Undefined and values are used." This is not a fatal error and will not force your php code to stop running, however, there is a potential risk of problems. Therefore, we recommend that you modify it ~~~~

This type of notice content does not affect the use of non-fatal issues.

Use E_ALL &~ E_NOTICE can disable notice Display. However, it is recommended that you change the code better :)

Code is always well written, so there will be fewer problems in the future :)

Enabling this notice display is also helpful for debugging errors ~~~~

If you use $ row = mysql_fetch_array ($ result,

When echo $ row ['name'], the Notice: Undefined index: problem occurs again, which may be:

1. the SQL statement is incorrect. The value in the name field is not read,

2. failed to execute the SQL statement and did not read any value

3. the SQL statement is correct and fails, but no matching record is found. Naturally, no $ row ['name']

4. Miscellaneous

Notice generally prompts errors that are not directly related to the execution code, but do not forget that notice sometimes returns redundant error messages.

When reading data such as $ row ['name'], there will be many Notice: Undefined index: Errors. what should I do? Error_reporting (E_ALL ~ E_NOTICE) is that true...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.