Home >Backend Development >PHP Tutorial >thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

WBOY
WBOYOriginal
2016-10-11 14:23:411035browse

First of all, let’s take a look at the picture. I explained in advance that this is TP2.0, so the writing method is in the manual I took the screenshot below. It should be correct
thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

Several fucking questions
1: The data from POST can be printed. Is it because the form can be submitted correctly?

2: I use the add method, but it cannot be inserted. Why? I printed the statement and the statement is like this! ! !

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

Why? I inserted it exactly according to the manual, and the screenshot of the manual is also above

3: The inserted data only has the auto-incremented id and the sort which defaults to 0int type, and nothing else can be entered into the database

I can only add it through this method. The problem is that this is not the way. It is troublesome to verify. I just want to do it through normal create

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

Seeking advice from experts! ! !

Reply content:

First of all, let’s take a look at the picture. I explained in advance that this is TP2.0, so the writing method is in the manual I took the screenshot below. It should be correct
thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

Several fucking questions
1: The data from POST can be printed. Is it because the form can be submitted correctly?

2: I use the add method, but it cannot be inserted. Why? I printed the statement and the statement is like this! ! !

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

Why? I inserted it exactly according to the manual, and the screenshot of the manual is also above

3: The inserted data only has the auto-incremented id and the sort which defaults to 0int type, and nothing else can be entered into the database

I can only add it through this method. The problem is that this is not the way. It is troublesome to verify. I just want to do it through normal create

thinkphp, hell again, why can it only be inserted through native sql statements? add does not work

Seeking advice from experts! ! !

The data method seems to have parameter filtering. Check to see if the data model cache has not been updated. Or try using add directly

When the subject add is inserted, $data['image']=$_POST['image']; is missing?

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