thinkphp 3.2 View model query out bool (false) solve

Source: Internet
Author: User
It's written in this model.
 
  Array (' Pictitle ', ' pictoken ', ' Piccategroy ', ' picauthor ', ' picposttime ', ' _type ' = ' left '),        ' picture_ Attachment ' =>array (' Pictureid ', ' pictureurl ', ' creattime ', ' _on ' = ' = Picture.pictoken ' picture_ Attachment.pictureid '),    );}

Picture and picture_attachment two tables
That's what the controller says. I instantiate Picview with the D method. Is this the real table name that must be in the database?
    Public Function  Pic () {         $PicModel =d (' Picview ');        Dump ($PicModel);         $s =   $PicModel->select ();        Dump ($s);    }


Some of the errors returned
["DB":p rotected] + object (think\db\driver\mysql) #8 (19) {
["DbType":p rotected] = NULL
["Autofree":p rotected] = bool (false)
["Model":p rotected] and string (7) "_think_"
["Pconnect":p rotected] = bool (false)
["Querystr":p rotected] = string (0) ""
["Modelsql":p rotected] = = Array (0) {
}
["Lastinsid":p rotected] = NULL
["NumRows":p rotected] = Int (0)
["Numcols":p rotected] = Int (0)
["Transtimes":p rotected] = Int (0)
["Error":p rotected] + string (0) ""
["LinkID":p rotected] = = Array (0) {
}
["_linkid":p rotected] = NULL
["Queryid":p rotected] = NULL
["Connected":p rotected] = bool (false)
["Autoinc":p rotected] = bool (false)
["Patchvalidate":p rotected] = bool (false)


Reply to discussion (solution)

# Picview Model initialization, if the Picview class exists is called and initialized, if it does not exist, the model is initialized according to the table name         $PicModel =d (' Picview '); #输出所有数据 actually executed SQL statement is # SELECT * FROM Picview         $s =   $PicModel->select ();

PHP Beginners do not recommend looking directly at the frame!

# Picview Model initialization, if the Picview class exists is called and initialized, if it does not exist, the model is initialized according to the table name         $PicModel =d (' Picview '); #输出所有数据 actually executed SQL statement is # SELECT * FROM Picview         $s =   $PicModel->select ();

PHP Beginners do not recommend looking directly at the frame!


Thank you, Good Samaritan. I've already solved it. Two table field sorting is not the same cause the other good frame use convenient point
  • 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: info-contact@alibabacloud.com 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.