php - Wordpress custom leftjoin on two tables -
i'm new idea of left-joining.
i have created 2 custom tables within wordpress database. 1 detail (containing leads) , 1 storing car dealers.
when send lead cardealer, store id of cardealer column "sent_to" in detail table. want show car dealers have received each lead.
and here comes leftjoin:
global $wpdb; $cardealers = $wpdb->get_results( "select detail.name, cardealers.user_id detail left join cardealers on cardealers.user_id = detail.sent_to" );
and how try input results:
foreach($cardealers $cardealer) { $name = $row->name; echo $name; }
but can guess, nothing happens.
hope can help.
Comments
Post a Comment