【微信开发】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

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Atom editor mac version download
The most popular open source editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
