Skip to content

A Database Error Occurred: missing default value for banned #66

@gitlabgis

Description

@gitlabgis

When creating a new user before login in,

I got the following error:

Error

Error Number: 1364

Field 'banned' doesn't have a default value

INSERT INTO `users` (`name`, `email`, `pass`, `votes`, `isadmin`) VALUES ('Comfort food', '[email protected]', '$2a$08$.hnucYdZeHrqVU96l22IGeRoO36IWFVaw4oqFSX.xkY3NwqhsE4Bu', 20, '0')

Filename: /var/www/models/post.php

Line Number: 54
Missing banned

Solution:

Add value for banned in array $data line 51

vi application/models/post.php

44         else{
 45                 $data = array(
 46                                 'name' => $name,
 47                 'email' => $email,
 48                                 'pass' => $pass,
 49                                 'votes' => $votes,
 50                                 'isadmin' => '0',
 51                                 'banned' => '0'
 52                         );
 53         }
 54 

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions