Idiorm is a lightweight ORM library on Sae. I found a simple and easy-to-use orm library idiorm. I wanted to use it because I thought it was convenient and I was afraid that I could write something that would have security issues.
His documents are as follows: http://idiorm.readthedocs.org/en/latest/index.html
Github address: https://github.com/j4mie/idiorm
The Index. php code is as follows:
Create (); $ account-> id = 11; $ account-> account = 1236; $ account-> save ();
They use the following in their documents:
The above code can be run on my local xampp
But there is a problem when it is put on SAEs.
Under my sae, I first created a database with the table name being account.
Then the two files are in the downstream of my Directory (ORM is the idiorm Library)
The code in index. php is:
create();$account->id = 11;$account->account = 1236;$account->save();?>
Then the following problems occur:
Therefore, I would like to ask my predecessors, who have been Baidu for a long time. my knowledge is limited.
Thank you.
Reply to discussion (solution)
SAE_MYSQL_XXXX is a constant!
ORM::configure('mysql:host=w.rdc.sae.sina.com.cn:3307;dbname=' . SAE_MYSQL_DB);ORM::configure('username', SAE_MYSQL_USER);ORM::configure('password', SAE_MYSQL_PASS);
In addition, the host name and port name also apply the constants SAE_MYSQL_HOST_M and SAE_MYSQL_PORT it provides.