PHP version: PHP 5.4.16
ThinkPHP version: 3.2.3
Go directly to the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
$sql = $ReportLost->fetchSql(true)->add($data);
1 |
|
Next execute $result = $ReportLost->add($data);
and an error will be reported:
1 |
|
However, the in
$sql
1 2 |
|
can be inserted.
Data table structure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
There are indeed more fields in the table than in $data, but any undefined fields in $data can be NULL.
Is this a limitation of thinkphp? Or is it a limitation of php? Is there any solution? Do I need to define all the fields required by mysql in $data first?