MySQL error in file: /engine/inc/addnews.php at line 864 Error Number: 1364 The error returned was: Field 'kp_id_movie' doesn't have a default value

tell me what the problem may be

line 864 indicates

$db->query( "INSERT INTO " . PREFIX . "_post (date, autor, short_story, full_story, xfields, title, descr, keywords, category, alt_name, allow_comm, approve, allow_main, fixed, allow_br, symbol, tags, metatitle) values ('$thistime', '{$author}', '$short_story', '$full_story', '$filecontents', '$title', '{$metatags['description']}', '{$metatags['keywords']}', '$category_list', '$alt_name', '$allow_comm', '$approve', '$allow_main', '$news_fixed', '$allow_br', '$catalog_url', '{$_POST['tags']}', '{$metatags['title']}')" ); 
  • The error is most likely due to the fact that you are not sending a value for the non-default column kp_id_movie . - mix
  • all values ​​are sent. just an error appeared after moving to a new server with a new version of the muscle - Nurullaev
  • >> all values ​​are sent I did not see in the request a link to the column kp_id_movie . This may be due to the version, since one version may ignore that the column has no default value, and the other will swear at it. - mix

1 answer 1

The behavior when adding a row without specifying a column with no default value depends on whether SQL strict mode is enabled.

http://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html

If strict mode is enabled, the request will return an error. If disabled, some implicit default value of this data type will be used. In mysql 5.7, SQL strict mode was enabled by default.

Although so far strict mode can be disabled, in future versions strict mode can be made non-disableable. It is better to specify the default value for the field using the query:

 ALTER TABLE table_name ALTER COLUMN column_name SET DEFAULT 'some_default_value'; 

Other differences from the strict mode included will most likely appear. Judging by the direct substitution of data in SQL, the application is not written very well.