About die-php Tutorial

Source: Internet
Author: User
Question about die & lt ;? Phpechofuck; $ dbmysql_connect (localhost, bp6am, 123) & nbsp; ordie (Unabletoconnect.); & nbsp ;? & Gt; this is my code. if there is no echo, the whole webpage is HTTPError500 (InternalServer's question about die ).
Echo 'fuck ';
$ Db = mysql_connect ('localhost', 'bp6am', '123 ')
Or die ('unable to connect .');
?>
This is my code
If no echo exists, the entire webpage is HTTP Error 500 (Internal Server Error). What is the role of this die?
Why does the webpage display fuck without an error message when echo is available?

------ Solution --------------------
Php does not enable the error display function.
Php. ini
Error_reporting = E_ALL &~ E_NOTICE
Display_errors = On
------ Solution --------------------
If no echo exists, the entire webpage is HTTP Error 500 (Internal Server Error ),
I personally think that you have not configured the web server. check that your apache IIS configuration can solve this problem.

DIE () is the string information output before the script is released. of course, if $ db = mysql_connect ('localhost', 'bp6am', '123 ')
Or die ('unable to connect .');
If the password is incorrect, the mysql -- query function error message is output, and the string information after the die is output. If yes, it is not displayed.

[Email protected] _ connect ('localhost', 'bp6am', '123 ')
Or die ('unable to connect. '); in this way, if the password is wrong, only Unable to connect will be output.


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.