www.webdeveloper.com
Results 1 to 4 of 4

Thread: Select * Returns duplicate data

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Location
    Brooklyn NY
    Posts
    104

    Select * Returns duplicate data

    I'm using a MySQL database, and I was wondering, Is there a way to use Select * from a table and not receive duplicates.

    Duplicates as in:

    Code:
    row[0] = 'john';
    row[1] = 'doe';
    row['first'] = 'john';
    row['last] = 'doe'
    Or is there atleast an easy way to get rid of the duplicates without having to do it one by one?

  2. #2
    Join Date
    Jul 2007
    Location
    Wisconsin
    Posts
    468
    if you're using PHP, you can use the second parameter of mysql_fetch_array() to specify the $result_type of MYSQL_ASSOC, MYSQL_NUM or MYSQL_BOTH.

  3. #3
    Join Date
    Apr 2010
    Location
    Brooklyn NY
    Posts
    104

    resolved

    Wooowww, you are my hero right now. Thanks, that's perfect

  4. #4
    Join Date
    Jun 2008
    Posts
    136
    Use mysql_fetch_assoc() instead. It returns only name associative values. (mysql_fetch_row() will return only numerics.)

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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