SELECT DISTINC

SELECT DISTINC

estudiosestudios Posts: 52Questions: 0Answers: 0
edited August 2013 in General
Dear all

Can someone tell me how to use "distinct" in the following code. I need SELECT DISTINCT from names...etc

$out['ex'] = $db
->query ('select')
->table ('names')
->join ('staff', 'staff.id = names.id')
->get ('names.id as value, staff.code as label' )
->exec()
->fetchAll();
Thanks a lot

Replies

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Currently you need to use the sql() method ( http://editor.datatables.net/docs/current/php/class-DataTables.Database.html#_sql ) as `distinct` is not abstracted by the PHP libraries. It seems like a sensible addition for a future release though! I'll ensure that it is in 1.3.

    Allan
This discussion has been closed.