I'm trying to get distinct values into a drop down list. I've used "DISTINCT" in the sql statement but to no effect. What I'm getting is
<option value="HSU001">Health & Safety Unit</option>
<option value="HSU001">Health & Safety Unit</option>
repeated 5 times. I thought if I could dump the id's and values into an associative array like this
$div = array($divcode => $division);
I could loop though them and only take out the distinct values. Any ideas? Thanks
fintan
SELECT TBLDIVISION.DIVCODE, TBLDIVISION.DIVISION, TBLUNIT.UNITID, TBLUNIT.UNIT FROM TBLDIVISION, TBLUNIT WHERE TBLUNIT.DIVCODE = TBLDIVISION.DIVCODE AND TBLDIVISION.DIVCODE IS NOT NULL ORDER BY TBLDIVISION.DIVISION, TBLUNIT.UNIT
I can take out all from one table but when I do the join, it prints out all matches but repeats them.