Php already supports Mysql, but it cannot be connected once connected to the database? What's going on,
Source: Internet
Author: User
Php already supports Mysql, but it cannot be connected once connected to the database? What's going on ,?? Mysql already exists in phpinfo (). But & lt ;? Php $ a = & quot; localhost & quot; $ B = & quot; root & quot; $ c = & quot; root & quot ;; $ connect = mysql_con php already supports Mysql, but it cannot be connected once a database is connected? What's going on ,??
Mysql already exists in phpinfo (). However
$ A = "localhost ";
$ B = "root ";
$ C = "root ";
$ Connect = mysql_connect ($ a, $ B, $ c );
If ($ connect) {echo "aaaaa ";}
Else echo "bbbb ";
// Mysql_select_db ("user ");
// $ Wa = "select * from user ";
// Mysql_query ($ wa );
?>
In this way, the webpage cannot be connected .. Not to mention connection or not... Explain
------ Solution --------------------
The code is okay. I have succeeded here. you are sure that your environment is successfully installed and the path is correctly configured. The database is started normally.
------ Solution --------------------
Is apache enabled?
------ Solution --------------------
Take a look at the apache log file
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