, PHP questions about database connection errors

Source: Internet
Author: User
For help, PHP has just migrated the website about database connection errors and checked the index of the root directory. php displays the database connection file code // database class require_once ('class/dbconfig. php '); require_once ('class/class_user.php'); r help, PHP database connection error
After migrating the website, I checked the index. php in the root directory to display the database connection file code.
// Database class
Require_once ('class/dbconfig. php ');
Require_once ('class/class_user.php ');
Require_once ('class/class_public.php ');
Require_once ('class/class_shop.php ');

Open the class/dbconfig. php file. the code is

PHP code
  Class dbconfig {// connect to the database function con () {$ con = mysql_connect ('2017. 0.0.1 ', 'root', '123'); mysql_select_db ("database_591", $ con); return $ con;} // run the SQL function getRs ($ SQL, $ con) {mysql_query ('set names utf8'); return mysql_query ($ SQL, $ con);} // run the SQL statement without returning the function deff_getRs ($ SQL, $ con) {mysql_unbuffered_query ('set names utf8'); return mysql_unbuffered_query ($ SQL, $ con);} // Close the dataset function c LearRS ($ rs) {mysql_free_result ($ rs);} // closes the database function clearDB ($ con) {mysql_close ($ con );} // function rsRows ($ rs) {return mysql_num_rows ($ rs);} // dataset pointer function rsSeek ($ rs, $ n = 0) {return mysql_data_seek ($ rs, $ n) ;}}$ db = new dbconfig;?>


Only 123456 is changed to your database password.

But I still cannot connect to the database website. I cannot open other related database files, and I can't change it or I can't. what's the problem? new to PHP? thank you for your advice.

------ Solution --------------------
The directory name is _ 519.
Then the database name is _ 519.

Mysql_select_db ("_ 591", $ con );

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.