0

When i was going to insert a student in my web app it was showing these error can anyone help me out.

Error Number: 1364

Field 'user_status' doesn't have a default value

INSERT INTO users (first_name, last_name, phone, profile_image, username, password, email, ip_address, created_on, last_login, active) VALUES ('dinesh', 'kumar', '+919591812528', 'fa07b9fc131dc4c7caadac44539c81c4.JPG', 'dinesh kumar', '$2y$08$8KVwr6dQWp8GtsXcFPrRsujqFIBGwdu9MEgMniAXdznXQifCHuDe2', 'dineshprivacy007@gmail.com', '49.207.177.226', 1503992683, 1503992683, 1)

Filename: /home/aspireng/aspiresms/models/ion_auth_model.php

Line Number: 872

Community
  • 1
  • 1
  • So what is unclear? – u_mulder Aug 29 '17 at 08:03
  • 2
    There's a field in your database called 'user_status' that is set to 'NOT NULL', and you don't have a default value for it. The poor database engine doesn't know what to do with the field. – Ben Hillier Aug 29 '17 at 08:03
  • 2
    Possible duplicate of [mysql error 1364 Field doesn't have a default values](https://stackoverflow.com/questions/15438840/mysql-error-1364-field-doesnt-have-a-default-values) – Michel Aug 29 '17 at 08:04

3 Answers3

0

user_status Column doesnt have a default value set, kindly set this field NULL as default, and then run query, or insert some value to this field.

Gaurav Rai
  • 900
  • 10
  • 23
0

if user_status field in your table, please set default value NULL if not assign.

0

This means there is a user_status column in you db which is expecting some value to be passed in. if you dont have any value to pass then do something like this

INSERT INTO users (first_name, last_name, phone, profile_image, username, password, email, ip_address, created_on, last_login, active,user_status) VALUES ('dinesh', 'kumar', '+919591812528', 'fa07b9fc131dc4c7caadac44539c81c4.JPG', 'dinesh kumar', '$2y$08$8KVwr6dQWp8GtsXcFPrRsujqFIBGwdu9MEgMniAXdznXQifCHuDe2', 'dineshprivacy007@gmail.com', '49.207.177.226', 1503992683, 1503992683, 1,'0')

your field user_status cannot be null so you need to pass any value in it. I just passed 0 for reference.

Nagesh Katna
  • 679
  • 2
  • 7
  • 27