In thinkPHP JOIN, do you want to add a prefix to the table name? how can this problem be solved?
Source: Internet
Author: User
Do you want to add a prefix to the table name in the JOIN operation of thinkPHP? if the table name is think_work, in the JOIN operation, modify the format to $ Model-& gt; join ('rightjoinworkonartist. id = work. artist_id ')-& gt; select (); or $ Model-& gt; join (do you want to add a prefix to the table name in the JOIN operation of thinkPHP?
If the table name is think_work
How to write in JOIN
Yes
$ Model-> join ('right JOIN work ON artist. id = work. artist_id ')-> select ();
Or
$ Model-> join ('right JOIN think_work ON think_artist.id = work. artist_id ')-> select (
Not written in the manual
It seems that neither of the two methods is successful.
Ah, how come there are so many tp problems? I 've been suffering from various problems for a day.
------ Solution --------------------
'Right JOIN think_work ON think_artist.id = think_work.artist_id'
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.