Thinkphp/SAE/database operations/D methods-php Tutorial

Source: Internet
Author: User
ThinkphpSAE database operation D method problems the local database originally had a mesg table, and then added a field maid after the table. Use & nbsp; $ mesgD (Mesg); & nbsp; dump ($ mesg) in an operation. The model contains protected $ _ maparray (user & gt; muser thinkphp/SAE/database operation/D method problems
The local database originally had a mesg table, and a maid field was added to the table.
Use
$ Mesg = D ('mesg ');
Dump ($ mesg );

The models include:
Protected $ _ map = array (
'User' => 'muser ',
'Content' => 'mcontent ',
'Time' => 'mtime ',
'Aid '=> 'Maid ',
);

The result contains the following:
["Fields: protected"] => array (8 ){
[0] => string (3) "mid"
[1] => string (4) "muid"
[2] => string (5) "muser"
[3] => string (8) "mcontent"
[4] => string (5) "mtime"
[5] => string (4) "maid" // This
["_ Autoinc"] => bool (true)
["_ Pk"] => string (3) "mid"
}

The maid field exists locally.
However, the result of the same operation is as follows:
["Fields": protected] => array (7 ){
[0] => string (3) "mid"
[1] => string (4) "muid"
[2] => string (5) "muser"
[3] => string (8) "mcontent"
[4] => string (5) "mtime"
["_ Autoinc"] => bool (true)
["_ Pk"] => string (3) "mid"
}

The following is normal on both local and sae:
["_ Map": protected] => array (4 ){
["User"] => string (5) "muser"
["Content"] => string (8) "mcontent"
["Time"] => string (5) "mtime"
["Aid"] => string (4) "maid"
}
The table above sae does not have that field. The field added later is invalid. it is also invalid if I re-upload all the tables.
Runtime deleted many times is also invalid. I don't know why?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.