[WeChat development] 01. Database authorization and connection, 01 database authorization
Built a WeiPHP framework application (called A) on Sina SAE and made a WeChat wall Function, I want to display the WeChat wall content through a front-end web page instead of through the WeiPHP framework. This requires authorizing the database of the WeiPHP framework application to the application of this web site (called B).
1. Database authorization
(1) Enter database management and click on cross-application authorization
(2) Authorize the database of application A to application B, click Authorize
2. Write the script to connect to the database of application B
(1) Modify the file: index.php
(2) Parameter meaning:
Main 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 results:
Web page display:
helloworld
4.Attention
If SAE_MYSQL_USER and SAE_MYSQL_PASS are filled in incorrectly, the web page will display the following information:
Warning: mysql_connect() [function.mysql-connect]: this app is not authorized in index.php on line 6
Author: Jackson Source: Huang Zhe’s blog http://www.cnblogs.com/jackson0714/p/4376000.html
http://www.bkjia.com/PHPjc/975800.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/975800.htmlTechArticle[WeChat Development] 01. Database authorization and connection, 01 database authorization built a WeiPHP framework application on Sina SAE (Called A), I made a WeChat wall function and wanted to use a former...