www.webdeveloper.com
Results 1 to 3 of 3

Thread: hope; simple question

  1. #1
    Join Date
    Jul 2005
    Location
    faisalabad, punjab, pakistan
    Posts
    241

    hope; simple question

    how can i reterieve result from mysql without repeating records means having same names ...

    e,g; if there exists 3 users with the same name
    query result shows only once except three

  2. #2
    Join Date
    Jan 2006
    Posts
    67
    PHP Code:
    select DISTINCT usernameotherfields FROM tablename 

  3. #3
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    379
    Note that DISTINCT applies to the whole row and not one column.

    So if you have for example usernames johnsmith99 and johnsmith99, one that is age 20 and another age 40, if you were to select username and age, the database would retrieve both rows, because as a row, they are distinct.
    The beauty of code is in its simplicity.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles