AND inside ->leftjoin
AND inside ->leftjoin
Gargiucn
Posts: 109Questions: 30Answers: 0
How to translate the statement:
LEFT JOIN contatti ON visite.visit_cli = contatti.cont_id** AND** contatti.cont_user = 4
into ->leftjoin() ?
Thanks...
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
https://editor.datatables.net/manual/php/joins
in addition you need to use a where clause for the "contattti.con_user = 4" part
https://editor.datatables.net/manual/php/conditions
so it should be
LEFT JOIN contatti ON visite.visit_cli = contatti.cont_id
WHERE contatti.cont_user = 4
with the links above you can translate this into what Editor expects.
->leftJoin( 'contatti', 'visite.visit_cli', '=', 'contatti.cont_id' )
->where( 'contatti.cont_user', 4)