What is the error? why can't I add only one message to the database using thinkphp PHPcodepublicfunctioninsert () {$ guest = M (& quot; Author & quot? what is the error, why can't I add only one piece of information to the database using thinkphp?
PHP code
Public function insert () {$ guest = M ("Author"); $ guest-> create (); $ guest-> add ();}
Only the first time can be added.
------ Solution --------------------
Data cache files. Because the Create () function will automatically Create some php files that store fields and perform type verification. During the 2nd Create () operation, if the file exists, it will not be searched in the database and will be used directly.
Therefore, after you modify the table structure, you must delete the cache file ......
The general location is in the project folder: \ KONAKONA_App \ Runtime \ Data \ _ fields \. it does not matter if all files under this folder are deleted, and will be automatically re-created.