0
votes

Field 'end_time' doesn't have a default value

INSERT INTO quiz_result (uid, quid, oids, qids, category_name, qids_range, start_time, last_response, time_spent, time_spent_ind, institute_id, photo) VALUES ('1', '2', '0,0,0,0,0', '1,2,6,4,3', 'General', '0-4', 1457200638, 1457200638, '0', '0,0,0,0,0', '1', '')

Filename: C:\wamp\www\online_test\system\database\DB_driver.php

Line Number: 330

3
what is your table structure? - Mohit

3 Answers

0
votes

You have a field named 'end_time' in a the table quiz_result that has been declared as NOT NULL (therefore the error Field 'end_time' doesn't have a default value each time you do not (or forgot) to provide a value for that column in each INSERTs). Check the column list and the column end_time is nowhere to be found.

You must either re-declare your table by setting a default value for it or provide a value for the column 'end_time' each time you insert a row to that table.

0
votes

I just moved hosting, and my web bug : Error Number: 1364

Field 'LuotXem' doesn't have a default value

INSERT INTO baiviet (TieuDe, Loai, Link, Title, H1, H2, Keyword, Description, NoiBat, NoiDung, TrangThai, NguoiGui, MenuCha, CapMenu, ViTri) VALUES ('dsaf', 'Banner', '', 0, 0, 0, 0, 0, 0, '

ádfasd \n', '1', '5', 0, 1, 'TOP')

Filename: /home/thanhdlk33/public_html/batdongsan3mien.com/models/default_model.php

Line Number: 13

file default_model.php :

<?php

error_reporting(0); class Default_model extends CI_Model{

function __contruct() 
{ 
    parrent::__contruct(); 

} 

//--- Them dong du lieu moi voi du lieu dau vao la 1 mang
function addDuLieuMoi($table,$data){
    if($this->db->insert($table,$data))
        return TRUE;
    else
        return FALSE;
}
-1
votes

Try checking case of of variables, because some db are case sensitive.