[WeChat development] 01. database authorization and connection, 01 database authorization _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
[Development] 01. database authorization and connection, 01 database authorization. [Development] 01. database authorization and connection. 01 database authorization builds A WeiPHP framework application (called A) on Sina SAEs. it implements A wall function and wants to use A previous [development] 01. database authorization and connection, 01 database authorization

A WeiPHP framework application (called A) is built on Sina SAEs. it implements A wall function and wants to display the Wall content through A front-end web page, rather than through the WeiPHP framework. In this case, you need to authorize the database of the WeiPHP framework application to the web site application (called B ).

1. database authorization (1) go to database management and click cross-application authorization

(2) authorize application A's database to application B and click authorize

2. Compile the database connection script for application B (1) modify the file index. php.
(2) parameter description: master database domain name: SAE_MYSQL_HOST_M
Slave Database domain name: SAE_MYSQL_HOST_S
Port: SAE_MYSQL_PORT username: SAE_MYSQL_USER (Access Key)
Password: SAE_MYSQL_PASS (Secret Key)
Database name: SAE_MYSQL_DB

3. view the result:

Webpage display:

Helloworld

4. Note

If SAE_MYSQL_USER and SAE_MYSQL_PASS are incorrect, the following information is displayed:

Warning: mysql_connect () [function. mysql-connect]: this app is not authorised in index. php on line 6

Author: Jackson Source: Huang Zhe blog http://www.cnblogs.com/jackson0714/p/4376000.html

Middleware built A WeiPHP framework application (called A) on Sina SAEs and implemented A wall function. I want to use A 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.