How to use r_select () in the brophp framework

Source: Internet
Author: User
I am confused about the usage of r_select () in the brophp Framework & nbsp; I am new to ask for a usage of the brophp framework r_select (). the source code is as follows: & nbsp; & nbs instructions on usage of r_select () in brophp framework
The newbie asks for a usage of the brophp framework r_select (). I am confused when using this function today. The source code is as follows:



$ Order = D ("user ");


$ OrderList = $ order-> field ("uid")-> where (array ("uid" => "8")-> r_select (array ('web _ order ', 'W _ orderid, w_orderTime, w_workid, w_finishTime, state', 'uid '));


P ($ orderList );


As shown above, I have two tables, user and web_order. uid is the primary key of the user table and the foreign key of the web_order table. you can use where () to restrict the user table, but how to restrict the field state of the web_order field in the slave table? Thanks for choosing phper.
To obtain uid = '8' & state = "not repaired ".
------ Solution --------------------
The ORG of brophp is very poor, and you have not considered such a requirement during design.
There are too many rules, and the parameter format is not uniform.

You can solve this problem by giving the join key additional table name of the parameter array of the where method
-> Where (array ("uid" => "8", 'Web _ order. state' => 'Val '))
Check whether the SQL command is correct using the SQL method.

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.