Sina Cloud provides a free service to create server-side applications. The website is: https://www.sinacloud.com/
Create a good app on it, and then write your app's code locally using Notepad as follows:
<? PHP Echo "Helloworld!" ;? >
This is one of the simplest behind the code, write well after save off, and then use SVN to upload to the app you just created. Open the URL to see the output HelloWorld this sentence.
Operational database:
1, create a shared MySQL database under the application, create a good will be shown as follows:
See the Sina Cloud website for a sample of how PHP operates the database:
API User manual SAE's PHP operating environment provides a standardMySQL, mysqli, and PDO modules to connect to the database and support all MySQL features, you can manipulate the database in the way you used to. here are some predefined constants related to sharing the MySQL database service, which you can directly reference to connect to the database: user name:sae_mysql_user Password:sae_mysql_pass Main Library domain name:sae_mysql_host_m from the library domain name:sae_mysql_host_s Port:Sae_mysql_port Database name:sae_mysql_db use method, take MYSQL module as an example: <?PHP//even the main library$db=mysql_connect(sae_mysql_host_m. ': '). Sae_mysql_port,sae_mysql_user,sae_mysql_pass);//Connect from library//$db = mysql_connect (sae_mysql_host_s. ': '). Sae_mysql_port,sae_mysql_user,sae_mysql_pass);if($db) { mysql_select_db(sae_mysql_db,$db); // ...}?>Note PDO does not support host:p ORT this notation, use the PDO standard notation
That's clear: Here are some predefined constants related to sharing the MySQL database service, and you can directly reference these parameters to connect to the database:
In other words, Sina has helped you to your main library address, from the library address, database name, and so has been defined as a macro definition, you directly use the following code, you do not need to replace the inside of the sae_mysql_host_m to its own main library address
$db = mysql_connect (sae_mysql_host_m. ': '). Sae_mysql_port,sae_mysql_user,sae_mysql_pass);
That is to say your code is < ph
// even the main library $db mysql_connect (sae_mysql_host_m. ': '). Sae_mysql_port,sae_mysql_user,sae_mysql_pass); if ($db) { // mysql_select_db (sae_mysql_db, $db);
Echo ' OK '// ...
}
Else
Echo ' Error '
?>
After writing the code, use SVN to upload to the cloud, and then click Cross-app authorization to the app in the created shared MySQL database management, then you can access it through the web.
PHP connection MySQL database (Sina cloud SAE)