>       I am trying to populate an array from a MySQL database.  I think I
> have the code correct to populate the array, but I need to somehow
> sort the array eliminating duplicate values.  I think I can loop
> through the array doing a comparison and building a new array by
> discarding the value if it is a duplicate, but I was not sure if
> there was a more efficient way of doing this.

You can ask for only unique values to be returned in the database result.

Try something like this:

$sql = "SELECT UNIQUE username FROM table WHERE where_clause ORDER BY

Katie Dewees
Web Developer/PHP Programmer

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to