Announcement

Collapse
No announcement yet.

Help please...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • scoutt
    replied
    no, because it all depends on what version they are using as to how distinct works.

    in version 3.23 you had to have group by or order by in it for it to work.

    so you could do something like this

    SELECT DISTINCT ip, location FROM usersonline GROUP BY ip

    Leave a comment:


  • megahard
    replied
    SELECT DISTINCT ip, location FROM usersonline

    should work o_0

    Leave a comment:


  • Matt*is*thick
    replied
    Originally posted by scoutt
    select count(ip) AS hits, location from table GROUP BY ip
    Thank you!

    Works like a dream

    Leave a comment:


  • scoutt
    replied
    select count(ip) AS hits, location from table GROUP BY ip

    Leave a comment:


  • Matt*is*thick
    replied
    Is there no-one who can do this? I have tried on about 50 forums and nobody seems to have a way that I can do it.

    Leave a comment:


  • Matt*is*thick
    started a topic Help please...

    Help please...

    I am making a who's online style page for my site but I am stuck. My usersonline table has 3 fields :

    timestamp,
    ip,
    location

    The thing is I want it to show distinct IPs, but I want to display the location with each of those.

    I tried :

    SELECT DISTINCT ip, location FROM usersonline

    But I got a list of ALL the ips

    How can I do this?

    Thanks in advance,

    Matt
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X