Home > Backend Development > PHP Tutorial > [WeChat Development] 01. Database authorization and connection, 01 Database authorization_PHP tutorial

[WeChat Development] 01. Database authorization and connection, 01 Database authorization_PHP tutorial

WBOY
Release: 2016-07-13 09:59:31
Original
1068 people have browsed it

[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

www.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...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template