Home > Backend Development > PHP Tutorial > thinkphp/SAE/数据库操作/D方法 有关问题

thinkphp/SAE/数据库操作/D方法 有关问题

WBOY
Release: 2016-06-13 13:04:48
Original
880 people have browsed it

thinkphp/SAE/数据库操作/D方法 问题
本地的数据库中本来有一个mesg表,后来在这个表后面增加了一个字段maid。
在某个操作中使用
  $mesg = D('Mesg');
  dump($mesg);

模型里有:
protected $_map = array(
'user'=>'muser',
'content'=>'mcontent',
'time'=>'mtime',
'aid'=>'maid',
);

结果中有这个:
["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"//这个
  ["_autoinc"] => bool(true)
  ["_pk"] => string(3) "mid"
  }

在本地里面是有maid字段的。
但是上传到sinaapp上面的时候,还是同样的操作,结果却是:
["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"
  }

而下面这个无论在本地还是sae上都是正常的:
["_map":protected] => array(4) {
  ["user"] => string(5) "muser"
  ["content"] => string(8) "mcontent"
  ["time"] => string(5) "mtime"
  ["aid"] => string(4) "maid"
  }
本来sae上面的table也是没有那个字段的,后来增加了字段无效,我把所有表重新传上去也无效。
runtime删了很多次也是无效,不知道是什么原因造成的?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template