Hi guys i am having a bit of a problem as i have a dynamic dropdown that populates it self from a database where user post messages and the thing is when a user posts more than one message it shows multiple instances of the same user in the dropdown menu so the basics working of it is as a admin user of site you can click the dropdown and then click submit to view all posts from that user, i know the DISTINCT command in mysql will only work on one field where as this table has 3 fields which all need to be unique the fields are title,firstname,lastname so the question is how do i do it so that MYSQL checks all 3 are unique and dont already exist in the dropdown so Mr Whoever Wherever does not appear 100 times if he posts 100 times,??? This is the code i currently have i have tried placing DISTINCT inbetween the query but it throws a error
$sql = "select Id,title,firstname,lastname from comments";
Here is the code i tried.
$sql = "select Id,title,firstname,DISTINCT (lastname)) from comments";
Any help would be greatly appreciatted Many Thanks Pinky.