Error Number: 1364

Por favor… O que pode ser esse erro?
Please … What could be this mistake?
When I make perfect localhost
But in online hosting it gives error

Error Number: 1364
Field 'data_log' doesn't have a default value

INSERT INTO `usuarios` (`nome`, `usuario`, `telefone`, `celular`, `senha`, `status`, `notas`, `data_registro`) VALUES ('Fabiano', 'admin', '(00) 0000-0000', 0, 'e26214d1060b9a5cda718c315444ad5caa7e5018902c68e13c921e1362b9061ce5e72b476fd92ad75fa80b6ff239b43adca9a8d9b460ff43e139fe85e325cfbc', '1', '', '01/09/2018 04:46:03')

Filename: /storage/ssd1/279/6922279/public_html/modulos/usuarios/models/crud_model.php
Line Number: 17
...................................................................

Error Number: 1364
Field 'status' doesn't have a default value

INSERT INTO `mesas` (`nome`, `lugares`) VALUES ('m8', '4')

Filename: /storage/ssd1/279/6922279/public_html/modulos/mesas/models/crud_model.php
Line Number: 17

Hi!

It means you forgot to specify a value for data_log column. Or perhaps you forgot to change it to AUTO_INCREMENT?

Thanks for listening
In the PHP MYadmin database I have put auto increment and is not allowed, it gives error

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Crud_model extends CI_Model { function __construct(){ parent::__construct(); $this->load->dbforge(); } public function listar($tabela){ $tabela_query = 'SELECT * FROM '.$tabela; $query = $this->db->query($tabela_query); return $query->result(); } public function inserir($tabela, $dados_banco){ return $this->db->insert($tabela, $dados_banco); return $this->db->insert_id(); } public function atualizar($tabela, $dados_banco, $id){ $this->db->where('id', $id); $this->db->update($tabela, $dados_banco); } public function remover($id, $tabela){ $this->db->delete($tabela, array('id' => $id)); } public function remover_por_campo($valor, $campo, $tabela){ $this->db->delete($tabela, array("$campo" => $valor)); } }

Thanks for the attention but I tried to change in the database for auto increment and it is not possible

The error thrown is?

Agradeço a atenção de todos, o erro estava no formato do da DATETIME do Sistema para o formato do Servidor. Corrigi no PHP e resolveu!
Valeu Galera!

1 Like