thinkPHP 无法create,无法插入数据,提示非法数据对象
4、thinkPHP 无法create,提示非法数据对象
解决方法:不要create+add,而用 data[]= '';+add
$m_r_fa_account = D('R_fa_account');
dump($m_r_fa_account);
$data['account_bank'] = 'ThinkPHP';
$data['account'] = 'ThinkPHP@gmail.com';
$result =$m_r_fa_account->data($data)->add();
代替原有的插入方式
/*
if($m_r_fa_account->create()){
dump('222'.$m_r_fa_account);
$m_r_fa_account->create_time = time();
$m_r_fa_account->update_time = time();
$m_r_fa_account->is_deleted = 0;
$m_r_fa_account->delete_time = 0;
$m_r_fa_account->fa_id = $result_fa_id;
$m_r_fa_account->add();
dump('add success');
}else{
dump($m_r_fa_account->getLastSql());
exit($m_r_fa_account->getError());
}
dump($m_r_fa_account->getLastSql());
*/