Question about die & lt ;? Phpecho 'Fuck '; $ db = mysql_connect ('localhost', 'bp6am', '000000') & nbsp; ordie ('unabletoconnect.'); & nbsp ;? & Gt; this is my code. if there is no echo, it's 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.
$ Db = @ mysql_connect ('localhost', 'bp6am', '123 ')
Or die ('unable to connect. '); in this way, if the password is wrong, only Unable to connect will be output.
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.