Conn statements commonly used in php -- very weak problems

Source: Internet
Author: User
The conn method commonly used in php-very weak problem. I went into contact with php on the first day and read the w3 tutorial. The problem is weak and has very few points. Mysql may have multiple databases (database 01, database 02, and database 03). Should I write the following statements when writing conn. php? & Lt ;? Php $ conn = m common conn writing in php-very weak problem
The first day of contact with php, read the w3 tutorial. The problem is weak and has very few points.

Mysql may have multiple databases (database 01, database 02, and database 03)
Should I write conn. php as follows?

 $ Conn = mysql_connect ("mysql database address", "username", "password ")
Mysql_select_db ("database 01", $ conn );
?>


And then in all files



Share:
------ Solution --------------------
Yes
------ Solution --------------------
The database name should be in English, which is more stable.
------ Solution --------------------
Well, it is like this.

------ Solution --------------------
Conn. php
$ Conn = mysql_connect ("mysql database address", "username", "password ");

Search, php
Include 'Conn. php ';
Mysql_select_db ("database 01", $ conn );
...
Mysql_close ($ conn );
Include 'Conn. php ';
Mysql_select_db ("database 02", $ conn );
...
Mysql_close ($ conn );
Include 'Conn. php ';
Mysql_select_db ("database 03", $ conn );
...
Mysql_close ($ conn );
?>

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.