Who used Sina cloud Ah, help Ah, a novice
The database in the Sina platform after the build, how and their own managed code to link up Ah, in PHP with mysql_connect () seemingly not AH
For example, create a file conn.php, the code is as follows
$conn = mysql_connect ("w.rdc.sae.sina.com.cn:3307", "Sae_mysql_user", "Sae_mysql_pass") or Die ("Database link error");
mysql_select_db ("BBS", $conn);
mysql_query ("Set names ' GBK '"); Use GBK Chinese code;
?>
It will appear every time you browse.
sae_warning:mysql_connect () [Function.mysql-connect]: This app isn't authorised in conn.php on line 2
Sae_warning:mysql_connect () [Function.mysql-connect]: in conn.php on line 2
Database link Error
How to do it, alas .....
------Solution--------------------
"Sae_mysql_user", "Sae_mysql_pass"???
Sae_mysql_user, Sae_mysql_pass
------Solution--------------------
Sae_mysql_user, Sae_mysql_pass
This is the user name and password for your database.
It's not for you to fill it up.
------Solution--------------------
Sae_mysql_user, Sae_mysql_pass
These two are the constant of the SAE, you write directly no problem. The problem is.
Mysql_connect ("w.rdc.sae.sina.com.cn:3307"
Also to write ...
$con = mysql_connect (sae_mysql_host_m. ': '). Sae_mysql_port,sae_mysql_user,sae_mysql_pass);
------Solution--------------------
There are two ways to do this.
First, use the variable that comes with the SAE.
Second, use the Saemysql class provided by SAE to operate
------Solution--------------------
Sea Direct query on it can AH
$mysql = new Saemysql ();
$sql = "SQL statement";
$data = $mysql->getdata ($sql);
The sea returns a multidimensional array
$data [xxx][' XXX '];
$mysql->closedb ();