例如,要存储timestamp的值是用MySQL now()函数,这时候可以这样,

 

$post = new Post;
$post->createTime=new CdbExpression('NOW()');
//$post->createTime='NOW()';will not work because 'NOW()' will be treated as a string
$post->save();

相关文章:

  • 2021-09-06
  • 2021-11-14
  • 2021-09-16
  • 2022-01-31
  • 2022-12-23
  • 2022-03-01
猜你喜欢
  • 2021-12-30
  • 2021-08-27
  • 2021-05-18
  • 2021-08-19
  • 2021-10-03
  • 2021-05-22
  • 2021-10-17
相关资源
相似解决方案