Table of Contents
[WeChat development] 01. Database authorization and connection, 01 database authorization
1. Database authorization
(1) Enter database management and click on cross-application authorization
2. Write the script to connect to the database of application B
(1) Modify the file: index.php
(2) Parameter meaning:
3. View results:
4.Attention
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

Jul 13, 2016 am 09:59 AM
and exist develop WeChat Authorize database Sina connect

[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...
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

The difference between H5 and mini-programs and APPs The difference between H5 and mini-programs and APPs Apr 06, 2025 am 10:42 AM

H5. The main difference between mini programs and APP is: technical architecture: H5 is based on web technology, and mini programs and APP are independent applications. Experience and functions: H5 is light and easy to use, with limited functions; mini programs are lightweight and have good interactiveness; APPs are powerful and have smooth experience. Compatibility: H5 is cross-platform compatible, applets and APPs are restricted by the platform. Development cost: H5 has low development cost, medium mini programs, and highest APP. Applicable scenarios: H5 is suitable for information display, applets are suitable for lightweight applications, and APPs are suitable for complex functions.

MySQL: An Introduction to the World's Most Popular Database MySQL: An Introduction to the World's Most Popular Database Apr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

What is the difference between H5 page production and WeChat applets What is the difference between H5 page production and WeChat applets Apr 05, 2025 pm 11:51 PM

H5 is more flexible and customizable, but requires skilled technology; mini programs are quick to get started and easy to maintain, but are limited by the WeChat framework.

What should I do if the company's security software conflicts with applications? How to troubleshoot HUES security software causes common software to fail to open? What should I do if the company's security software conflicts with applications? How to troubleshoot HUES security software causes common software to fail to open? Apr 01, 2025 pm 10:48 PM

Compatibility issues and troubleshooting methods for company security software and application. Many companies will install security software in order to ensure intranet security. However, security software sometimes...

How to solve the problem of JS resource caching in enterprise WeChat? How to solve the problem of JS resource caching in enterprise WeChat? Apr 04, 2025 pm 05:06 PM

Discussion on the JS resource caching issue of Enterprise WeChat. When upgrading project functions, some users often encounter situations where they fail to successfully upgrade, especially in the enterprise...

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

Is the company's security software causing the application to fail to run? How to troubleshoot and solve it? Is the company's security software causing the application to fail to run? How to troubleshoot and solve it? Apr 19, 2025 pm 04:51 PM

Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

See all articles