PHP连接SAE平台MYSQL
Jun 06, 2016 am 09:51 AM
mysqlphpcodeplatformOpen sourceprogrammingprogramming languagesoftware developmentconnect
这些是SAE中用到的常量,不清楚时去你在SAE中创建应用可以找到:
SAE_MYSQL_USER:用户名<br>SAE_MYSQL_PASS:密码: <br>SAE_MYSQL_HOST_M:主库域名<br>SAE_MYSQL_HOST_S:从库域名 <br>SAE_MYSQL_PORT:端口: <br>SAE_MYSQL_DB数据库名
数据库连接:
$link = mysql_connect ( SAE_MYSQL_HOST_M . ':' . SAE_MYSQL_PORT, SAE_MYSQL_USER, SAE_MYSQL_PASS );
注意在数据库和页面的编码不一样时,取到的值或者是你的页面有乱码情况
解决如下:
<meta http-equiv="<span" style="color: #800000;">"<span style="color: #800000;">Content-Type</span><span style="color: #800000;">"</span> content=<span style="color: #800000;">"</span><span style="color: #800000;">text/html; charset=gbk</span><span style="color: #800000;">"</span> />
或者
mysql_set_charset("gbk");
完整代码:下面例子中红色部分为解决编码问题
<br><br><span style="color: #ff0000;"><meta http-equiv="Content-Type" content="text/html; charset=gbk"></span><br><br><br>
鐢ㄦ埛ID | 鐢ㄦ埛鍚嶇О |
Statement
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
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
Roblox: Grow A Garden - Complete Mutation Guide
4 weeks agoByDDD
Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Clair Obscur: Expedition 33 UE-Sandfall Game Crash? 3 Ways!
2 weeks agoByDDD

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

SublimeText3 Chinese version
Chinese version, very easy to use

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!
