Thinkphp/SAE/database operations/D method problems

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
$ 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?


Reply to discussion (solution)

Check that the table structure on the sae side has been modified.
After local debugging is successful in the sae mode, submit the entire project again.

Check that the table structure on the sae side has been modified.
After local debugging is successful in the sae mode, submit the entire project again.

The structure of the sae table has been modified.
What does "waiting for local debugging to be successful in sae mode" mean?

Check that the table structure on the sae side has been modified.
After local debugging is successful in the sae mode, submit the entire project again.

Now I create the second version, and copy all the first version !!
Thank you!
But I want to know why?

Didn't you use sae for debugging on your machine?

Regular project portal file
Require './ThinkPHP. php ';

SAE project portal file
Require './ThinkPHP/Extend/Engine/Sae. php ';

Check that the table structure on the sae side has been modified.
After local debugging is successful in the sae mode, submit the entire project again.

In addition, I would like to ask how to resubmit the first version if I don't get the second version?
I don't know how to submit it again.

Didn't you use sae for debugging on your machine?

Regular project portal file
Require './ThinkPHP. php ';

SAE project portal file
Require './ThinkPHP/Extend/Engine/Sae. php ';

Well, this is clear.

In addition, I would like to ask how to resubmit the first version if I don't get the second version?
I don't know how to submit it again. Didn't you use SVN software?
Right-click the project directory and choose submit.

Reference reply on the fifth floor:

In addition, I would like to ask how to resubmit the first version if I don't get the second version?
I don't know how to submit it again.
Didn't you use SVN software?
Right-click the project directory and choose submit.

In this case, after the submission, it does not work, or the problem still exists.
However, I fixed the problem by recreating a version.
I don't know why.

I also encountered this problem. I searched the internet and said it was a problem with the KVDB cache. Then I disabled KVDB and enabled it again, but this still happens. After some tossing, I realized that KVDB is disabled and the cache is not cleared. although I was prompted when the cache was disabled, at least I was not cleared, so I don't have to worry about the reason.
You can use the following code to view your KVDB cache content.
[Code] $ kv = new SaeKV ();
$ Ret = $ kv-> init ();
$ Ret = $ kv-> pkrget ('', 100 );
Dump ($ ret );
[/Code]

If you disable and re-enable KVDB and run the above code to output the cached content, it means that the KVDB cache is still in progress.
Copy the following code to solve all problems after execution.
[Code] $ kv = new SaeKV (); // Create a SaeKV object
$ Ret = $ kv-> init (); // Initialization
$ Ret = $ kv-> pkrget ('', 100); // Obtain the cached content (the upper limit is 100 in the help document)
$ This-> show ('Current KVDB cache content ');
Dump ($ ret );
// Traverse and delete
Foreach ($ ret as $ key => $ value ){
$ Ret = $ kv-> delete ($ key );
}
$ This-> show ('');
$ This-> show ('clear the content cached by KVDB ');
$ Ret = $ kv-> pkrget ('', 100 );
Dump ($ ret );
If (! $ Ret ){
$ This-> show ('');
$ This-> show ('kvdb cleared successfully ');
};
[/Code]

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.