新浪云平台SAE升级到了php5.6,由于php5.6废弃了mysql_connet方法,下面语句不可用:
mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT, SAE_MYSQL_USER, SAE_MYSQL_PASS);
要用新的方法,注意$port端口的位置:
<?php
$host = SAE_MYSQL_HOST_M;
$port = SAE_MYSQL_PORT;
$dbname = SAE_MYSQL_DB;
$user = SAE_MYSQL_USER;
$pass = SAE_MYSQL_PASS;
$link = mysqli_connect($host, $user, $pass, $dbname, $port);
if (!$link) {
die('Connect Error (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
// echo 'Success... ' . mysqli_get_host_info($link) . "\n";
?>