【微信开发】01.数据库授权和连接,01数据库授权
【微信开发】01.数据库授权和连接,01数据库授权
在新浪SAE上面搭建了一个WeiPHP框架应用(称作A),做了一个微信墙的功能,想通过一个前端web页面显示微信墙内容,而不是通过WeiPHP框架。这就需要将WeiPHP框架应用的数据库授权给这个web站点的应用(称作B)。
1. 数据库授权
(1)进入数据库管理,点击跨应用授权
(2)将A应用的数据库授权给B应用,点击授权
2.编写B应用的连接数据库的脚本
(1)修改文件:index.php
(2)参数含义:
主库域名 : SAE_MYSQL_HOST_M从库域名 : SAE_MYSQL_HOST_S
端 口 : SAE_MYSQL_PORT 用户名 : SAE_MYSQL_USER(Access Key)
密 码 : SAE_MYSQL_PASS(Secret Key)
数据库名 : SAE_MYSQL_DB
3.查看结果:
网页显示:
helloworld
4.注意
如果SAE_MYSQL_USER和SAE_MYSQL_PASS填写的不正确,网页将会显示以下信息:
Warning: mysql_connect() [function.mysql-connect]: this app is not authorised in index.php on line 6
作者:Jackson 出处:黄哲同学的博客http://www.cnblogs.com/jackson0714/p/4376000.html

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











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.

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.

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

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

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

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

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.
