View Full Version : Distinct Results?

11-11-2002, 05:04 AM
Can somebody tell how I can prevent duplicate rows from printing queries? I know it's something like this $query ="SELECT DISTINCT ip_address FROM logs";, but I can't get the other fields to print when using this method.

Here's a list of all the fields that I currently have printing out.

$query = "SELECT id, time, ip_address, hostname, referrer FROM logs";

How can I do this using DISTINCT?


11-11-2002, 07:55 AM
SELECT DISTINCT ip_address, id, time, hostname, referrer FROM logs;