php - Medoo Syntax for Join Query with Two Foreign Keys -


i've requirement perform join operation in sql 2 foreign keys on same table. answer in below post has sql requirement.

join on 2 foreign keys same table in sql

i trying convert query medoo syntax, don't desired output. code posted below latest effort doesn't work.

$db -> select( "item_tbl", [ "[>]user_tbl.id" => ["ownerid", "lastmodifiedbyid"] ], ["username", "username", "itemname"]); 

could please help?

i've framed medoo syntax myself using aliases. below medoo equivalent code above sql:

$db->select("item_tbl",["[><]user_tbl(user_tbl_a)" => ["item_tbl.ownerid" => "id"],"[><]user_tbl(user_tbl_b)" => ["item_tbl.lastmodifiedbyid" => "id"]],["user_tbl_a.username(owner)","user_tbl_b.username(modifier)","itemname"]); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -