php - 字段 'lot_size' 没有默认值
问题描述
我已经安装了一个 php 脚本,但是现在当我托盘添加一个帖子时,我得到了这个错误。有人能帮我吗。
我对代码没有太多经验
发生数据库错误错误号:1364
字段 'lot_size' 没有默认值
INSERT INTO `dbc_posts` (`unique_id`, `type`, `purpose`, `total_price`,
`price_per_unit`, `price_unit`, `home_size`, `home_size_unit`,
`bedroom`, `bath`, `year_built`, `estate_condition`, `address`,
`country`, `state`, `city`, `zip_code`, `latitude`, `longitude`,
`facilities`, `featured_img`, `create_time`, `publish_time`,
`created_by`, `status`)
VALUES ('5ce24237ec6c1', 'DBC_TYPE_APARTMENT', 'DBC_PURPOSE_SALE', '35000',
'1000', 'sqft', '350', 'sqft', '5', '3', '2008', 'DBC_CONDITION_NEW',
'Molenvlietbrink', '1', 82, 83, '3448hs', '456888865', '3566784',
'[\"2\",\"9\"]', '22808@2x.jpg', 1558331959, '2019-05-20', '4', 1)
文件名:/home/lh0w054p6m7c/public_html/relcon/modules/admin/models/realestate_model_core.php
行号:59
Realstate_model_core.php 文件代码
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Memento category_model_core model
*
* This class handles category_model_core management related functionality
*
* @package Admin
* @subpackage category_model_core
* @author dbcinfotech
* @link http://dbcinfotech.net
*/
class Realestate_model_core extends CI_Model
{
var $category,$menu;
function __construct()
{
parent::__construct();
$this->load->database();
$this->category = array();
}
function check_post_permission($id)
{
$post = $this->get_estate_by_id($id);
if(is_admin()==FALSE && $post->created_by!=$this->session->userdata('user_id'))
{
return FALSE;
}
else
return TRUE;
}
function get_estate_by_id($id)
{
$query = $this->db->get_where('posts',array('id'=>$id,'status !='=>0));
if($query->num_rows()>0)
{
return $query->row();
}
else
{
die('Estate not found');
}
}
function update_estate($data,$id)
{
$this->db->update('posts',$data,array('id'=>$id));
}
function update_estate_meta($data,$id,$key)
{
$this->db->update('post_meta',$data,array('post_id'=>$id,'key'=>$key));
}
function insert_estate($data)
{
$this->db->insert('posts',$data);
return $this->db->insert_id();
}
function insert_estate_meta($data)
{
$this->db->insert('post_meta',$data);
}
function get_all_estates_admin($start,$limit,$order_by='id',$order_type='asc')
{
解决方案
推荐阅读
- teradata - 将 SQL 十进制字段粘贴到 EXCEL
- javascript - axios 通过后端生成的文件名下载文件
- xpath - XPath:提取属性值加上子元素的内部文本
- c# - 我怎样才能用 C# 实现 Node.js 的异步性?
- php - 我想在验证用户输入后向 mySQL 数据库添加一条记录
- .net-core - 有人可以确认 .NET Core 无法运行使用 System.Configuration.ConfigurationManager 的旧 .NET 类库吗
- scala - 如何正确破译兰巴/匿名表达式
- php - 曾经工作的重新调整用途的 PHP/MySQL CRUD 代码不再工作
- java - 在 Linux Fedora Hyper-V 虚拟机上独立启动 HBase 时出错
- c - C中区块链的Nonce函数。C中无符号字符数组的连接