How to use an 'AND' in a Join for DataTables PHP

How to use an 'AND' in a Join for DataTables PHP

SSzretterSSzretter Posts: 3Questions: 3Answers: 0

I have a simple join that looks like this, joins from the employee table to the clienttests table using 'pk' and 'clientID'.

->leftJoin( 'clienttests as cTest', 'cTest.clientID', '=', 'employee.pk' )

I would like to be able to add an additional condition, an 'AND' that happens to be statically defined in this case.

SO for example it would be like this:

left join clienttests cTest on cTest.clientID = employee.pk AND cTest.testType='123'

Basically I am trying to limit the specific records I am getting back from clienttests to records that have testType '123'.

Thanks

Answers

This discussion has been closed.