The reason for inserting the data of the failed data table mysql

1. Case Code:

$ sql1 = "insert into content ( category, subject, content, username, release_date) values ( '{$ category}', '{$ subject}', '{$ content}', '{$ user}', '{ DATE} $ ') ";
// inserting data into the data table operating
= dml ($ sql1 $ res1) ;


2. Cause:
each field (1) Check the data sheet spelled correctly;

Value (2) Check the inserted variable, using the statement var_dump ($ xxx), the variable value view of this format, the value is correct;

NULL field (3) checks data table, use the command desc table_name, when one or more field attributes not null, the data was not inserted, the insertion will cause data errors. (This is the reason for the error in this case)


Original link: https: //blog.csdn.net/hgq_csdn/article/details/53456247

Guess you like

Origin www.cnblogs.com/nxmxl/p/11708357.html