Ask the big God help pointing brother here where the error. is not connected to the database

Source: Internet
Author: User
Tags what php
The great God help you to guide. Little Brother Beginner PHP and database connection


Reply to discussion (solution)


What's wrong with the report?

What's wrong with the report?


Which means the 8th line of code is wrong

The error message is posted, the code is also best to paste the text out.

The error message is posted, the code is also best to paste the text out.


Well. Now I've turned off the computer. It's only tomorrow morning.

127.0.0.1 Change to localhost

Delete the blank in front of the $conn
Estimated to be full-width characters

Or maybe the mysql_connect function is undefined.
Because Phpmysqladmin uses the mysqli extension by default, you do not load the MySQL extension

127.0.0.1 Change to localhost


No way. I tried. I changed the SQL login password. It turned into a denial of access.


127.0.0.1 Change to localhost


No way. I tried. I changed the SQL login password. It turned into a denial of access.


phpMyAdmin The password of the link database inside the configuration file is wrong

What did you change the password to?

What did you change the password to?


There is no report of the mistake. Now that's it. I looked it up on the internet as if the PHP call mysql_connect () function handled an error. But I don't know how to change it.








$conn = mysql_connect ("localhost", "root", "") or Die ("database connection timed out, please try again later!");
mysql_select_db ("BBS", $conn);
mysql_query ("Set names ' UTF8 '");

$sql = "SELECT * from ' Student '";
$result = mysql_query ($sql);
?>














while ($row = Mysql_fetch_array ($result)) {?> }?>
Name: Address: Phone: Age:
Content:





The source code is like this

Yes, I told you, right?
You did not load the MySQL extension, so there is no definition for mysql_connect

Yes, I told you, right?
You did not load the MySQL extension, so there is no definition for mysql_connect


So what?

Ini
Extension=php_mysql.dll

Ini
Extension=php_mysql.dll


Add this sentence to the config file?

You don't even know what php.ini is?

You don't even know what php.ini is?


You know, yes.

Remove the previous # number

Every day a reply, happiness all day


Ini
Extension=php_mysql.dll


Add this sentence to the config file?


is to remove the word ";" from the front.
  • 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.