thinkphp3.2 Why the Select has no data in the controller

Source: Internet
Author: User
thinkphp3.2 in the controller why does the select have no data?
Just learn thinkphp, please give us a lot of advice.
Class Indexcontroller extends Controller {
Public Function index () {
$Dao = M ("article");
$articles = $Dao->select (); Do not retrieve data with select
$articles = $Dao->query ("SELECT * from think_article"); Use query to have data

$this->assign (' articles ', $articles);
Output template
$this->display ();

In the application also set ' db_prefix ' = ' think_ '.
Operating environment: Ubuntu, MySQL.
Why can't I use Select to retrieve the data? Please advise us. Thank you.

share to: more

$Dao = M ("article");
$articles = $Dao->select (); Do not retrieve data with select
echo $Dao->getlastsql ();

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.