PHP Database Insert data problem, die or die plug in, seek the guidance of the Great God
This post was last edited by Hipyaohop on 2013-06-28 10:12:39
jquery Code:
$ (". Detailtextable"). Click (function () {
$s _keshi=$ (". Cla_title"). attr ("alt")
PHP and MySQL connection has three kinds of API interface, namely: PHP mysql extension, php mysqli extension, PHP data Object (PDO), below for the above three kinds of connection methods to do a summary, in order to choose the best solution under
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
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
The question about die
echo ' Fuck ';
$db =mysql_connect (' localhost ', ' bp6am ', ' 123 ')
Or Die (' Unable to connect. ');
?>
This is my code.
Without echo, the entire Web page is HTTP error Internal Server error, and what does this die do here?
Concrete Example 1. PHP Server ComponentsFor beginners, it is recommended to use the integrated server component, which already includes PHP, Apache, Mysql and other services, eliminating the time spent by developers in the tedious configuration
Test the PHP file
$link =mysql_connect (' localhost ', ' root ', ' zz ') or Die (Mysql_error ());
mysql_select_db (' test ') or Die (' no db ');
mysql_query (' SET NAMES utf8 ');
Echo 99;
?>
Error after run
Can ' t connect to the local MySQL server
PHP file for test
$ Link = mysql_connect ('localhost', 'root', 'zz ') or die (mysql_error ());
Mysql_select_db ('test') or die ('no db ');
Mysql_query ('set NAMES utf8 ');
Echo 99;
?>
Error reported after running
Can't connect to local MySQL server
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.