Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-11-2002, 04:04 AM   PM User | #1
John_Saunders
New Coder

 
Join Date: Aug 2002
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
John_Saunders is an unknown quantity at this point
Distinct Results?

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?


John
John_Saunders is offline   Reply With Quote
Old 11-11-2002, 06:55 AM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,224
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
SELECT DISTINCT ip_address, id, time, hostname, referrer FROM logs;
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:29 AM.


Advertisement
Log in to turn off these ads.