Home  >  Article  >  Backend Development  >  I encountered a weird problem when inserting TP data, please help!

I encountered a weird problem when inserting TP data, please help!

WBOY
WBOYOriginal
2016-09-27 14:18:151080browse

I encountered a weird problem when inserting TP data, please help!

This is the form for adding a page, see the sorting one

I encountered a weird problem when inserting TP data, please help!

This is the code for the controller
I encountered a weird problem when inserting TP data, please help!

This is the database.

The question is as follows, it’s so damned! ! !

I have such a simple form, why when inserting, the sort field cannot be inserted into the table? Looking at my controller, no matter whether I use the default one or specially use $_POST to collect it, I can't insert it. I printed the sql statement and found that it didn't write this field in at all

I encountered a weird problem when inserting TP data, please help!

I’m really broken, I don’t know what went wrong to cause this

The database, paixu field, is int(10). I chose this name because sort was not working and I thought about whether it was a keyword, so I changed it

Also, I didn’t write the model, so it’s not caused by a problem with the model, it’s the one that only receives a certain amount of data

Can anyone help me check it out? Has anyone encountered this problem? Thank you everyone

Reply content:

I encountered a weird problem when inserting TP data, please help!

This is the form for adding a page, see the sorting one

I encountered a weird problem when inserting TP data, please help!

This is the code for the controller
I encountered a weird problem when inserting TP data, please help!

This is the database.

The question is as follows, it’s so damned! ! !

I have such a simple form, why when inserting, the sort field cannot be inserted into the table? Looking at my controller, no matter whether I use the default one or specially use $_POST to collect it, I can't insert it. I printed the sql statement and found that it didn't write this field in at all

I encountered a weird problem when inserting TP data, please help!

I’m really broken, I don’t know what went wrong to cause this

The database, paixu field, is int(10). I chose this name because sort was not working and I thought about whether it was a keyword, so I changed it

Also, I didn’t write the model, so it’s not caused by a problem with the model, it’s the one that only receives a certain amount of data

Can anyone help me check it out? Has anyone encountered this problem? Thank you everyone

Let me talk about a situation I encountered before. When a new field was added to the table, the data submitted by the form could not be stored in the database after turning off the debug mode. After turning on the debug mode, it returned to normal. Then, it was enough to delete the database cache file in the Runtime/Data/_fields/ folder. . I don't know if it's the same situation as mine, the old data table structure is cached.

Is it because the paixu field is not defined in your model?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn