How to record unknown errors in MySQL _ MySQL

Source: Internet
Author: User
How does one record unknown errors in MySQL when using MySQL as a site? The solution is as follows:

Class. method

// Create an error log
Function error (){
$ Fp = @ fopen ("error. dat", "a + ");
$ Time = date ("Y-m-d H: I: s ");
$ Msg = "{VisitedTime: $ time}/t
{VisiterIP:
When MySQL is used as a site, unknown errors may occur. how can this problem be recorded? The solution is as follows:

___ FCKpd ___ 0

The above code is an error record method in a class I used.
This is called on the page that uses the MySQL connection.
The following code directly creates an error log in your Directory.


If (MySQL_error ()){
$ Classname-> error ();
}

________________________

If an error occurs on your page, the information will not be leaked as long as you shield the page for concealment.
Error. dat content is (eg .)


{VisitedTime: 2002-05-09 14:43:56}
{VisiterIP: 127.0.0.1}
{Errormsg: Duplicate entry '0' for key 1}
{File:->/path/errorfilename. PHP}
{User: sports98}

Such records are certainly good for analysis pages.
If you are using include, do not add _ LINE __
If you are using require, we recommend that you add _ LINE _ to help you quickly locate the error and solve the problem.
SERVER [REMOTE_ADDR]}/t
{Errormsg: ". MySQL_error ()."}/t
{File:->

When MySQL is used as a site, unknown errors may occur. how can this problem be recorded? The solution is as follows:


___ FCKpd ___ 0

The above code is an error record method in a class I used.
This is called on the page that uses the MySQL connection.
The following code directly creates an error log in your Directory.


___ FCKpd ___ 1

If an error occurs on your page, the information will not be leaked as long as you shield the page for concealment.
Error. dat content is (eg .)


___ FCKpd ___ 2

Such records are certainly good for analysis pages.
If you are using include, do not add _ LINE __
If you are using require, we recommend that you add _ LINE _ to help you quickly locate the error and solve the problem.
SERVER [PHP_SELF]}/t
{User:

When MySQL is used as a site, unknown errors may occur. how can this problem be recorded? The solution is as follows:


___ FCKpd ___ 0

The above code is an error record method in a class I used.
This is called on the page that uses the MySQL connection.
The following code directly creates an error log in your Directory.


___ FCKpd ___ 1

If an error occurs on your page, the information will not be leaked as long as you shield the page for concealment.
Error. dat content is (eg .)


___ FCKpd ___ 2

Such records are certainly good for analysis pages.
If you are using include, do not add _ LINE __
If you are using require, we recommend that you add _ LINE _ to help you quickly locate the error and solve the problem.
SESSION [user]}/r/n ";
@ Fputs ($ fp, $ msg );
@ Fclose ($ fp );
}

The above code is an error record method in a class I used.

This is called on the page that uses the MySQL connection.

The following code directly creates an error log in your Directory.

___ FCKpd ___ 1

If an error occurs on your page, the information will not be leaked as long as you shield the page for concealment.

Error. dat content is (eg .)

___ FCKpd ___ 2

Such records are certainly good for analysis pages.

If you are using include, do not add _ LINE __

If you are using require, we recommend that you add _ LINE _ to help you quickly locate the error and solve the problem.

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.