Home > Backend Development > PHP Tutorial > Problems when operating tp5 model using database

Problems when operating tp5 model using database

WBOY
Release: 2016-10-22 12:06:43
Original
1584 people have browsed it
$list = model('weather')->select();<br> Dump($list);//What is returned at this time is the object generated by model('weather'), and does not enter the select() method of the Query class;<br> <br> <br> $list = model('weather')->where('id',1)->select();<br> dump($list);//The object returned is still the object generated by model('weather'). The select() method of the Query class that has been entered, at line 1896 $result = new $model($result);, re- The queried data becomes the same as the object generated by model('weather'). Is it because the model cannot use the select method? Use model to use value, column is used normally

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