meekro - MySQL Left Join (using MeekroDB) -


this meekrodb exclusive issue, trying wrap head around left_join.

i have 2 tables: comp_checklist , comp_checklist_items

i want rows comp_checklist user id matches , worked fine:

db::query("select * comp_checklist user_id = %i", $user_id );

now wand same query ( rows comp_checklist user id matches ) , add comp_checklist_items rows checklist_id matches in both tables (checklist_id primary key in comp_checklist table). used below false

db::query("select * comp_checklist user_id = %i left join comp_checklist_items on checklist_id = comp_checklist.checklist_id", $user_id );

join should come before where, , columns should have table name or error:

db::query("select * comp_checklist             left join comp_checklist_items             on comp_checklist_items.checklist_id = comp_checklist.checklist_id             comp_checklist.user_id = %i ", $user_id ); 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -