create(); "/> create(); ">

这是什么东东,小弟我用thinkphp为什么只能往数据库添加一条信息

WBOY
Release: 2016-06-13 10:56:53
Original
834 people have browsed it

这是什么错误,我用thinkphp为什么只能往数据库添加一条信息

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->public function insert(){                                            $guest=M("Author");                $guest->create();                $guest->add();                                }
Copy after login



只有第一次能添加进去,求解

------解决方案--------------------
Data缓存文件搞的鬼。因为Create()函数会自动创建一些存储了字段的php文件,然后进行类型效验。在第2次Create()的时候,如果这个文件存在就不再去数据库里查找了,直接用。
 所以这里的缓存文件,在你改了表结构后,必须删……
 
一般位置在项目文件夹下:\KONAKONA_App\Runtime\Data\_fields\ 这底下的文件全删都没关系,会自动重新创建。
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!