Because the SAE PHP does not have file write permission, it uses MySQL to store data. Here are some simple notes to use.
1, some constants
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_my sql_db
2. The Saemysql class based on the MySQL module provided by SAE:
<?php$mysql = new Saemysql (); $sql = "select * from ' user ' LIMIT"; $data = $mysql->getdata ($sql); $name = Strip_ta GS ($_request[' name ')); $age = Intval ($_request[' age '); $sql = "INSERT into ' user ' (' name ', ' age ', ' regtime ') VALUE S (' " . $mysql->escape ($name). "‘ , ‘" . Intval ($age). "', Now ())"; $mysql->runsql ($sql); if ($mysql->errno ()! = 0) {die ("Error:". $mysql->errmsg ());} $mysql->closedb ();? >
3, can also use the standard Mysql,mysqli and PDO module, with MySQL as an example
<?php//The main library $link=mysql_connect (sae_mysql_host_m. ': '). Sae_mysql_port,sae_mysql_user,sae_mysql_pass); if ($link)
{ mysql_select_db (sae_mysql_db, $link);}? >
Simple use notes for the "SAE" MySQL Database