字段“ lot_size”没有默认值

时间:2019-05-20 06:20:48

标签: php mysql database

我已经安装了一个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')
    {

0 个答案:

没有答案