At the beginning, when I connected to the server, I wrote this.
$link = mysql_connect('w.rdc.sae.sina.com.cn:3307','','');
It turns out that when connecting to the server, you should connect like this
$link=mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS); 附: <?php // 连主库 $link=mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS); // 连从库 // $link=mysql_connect(SAE_MYSQL_HOST_S.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS); if($link) { mysql_select_db(SAE_MYSQL_DB,$link); }
Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above introduces the problem solving when PHP connects to Sina Cloud and mySQL database, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.