SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: unique value

  1. #1
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    226
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question unique value

    PHP Code:
    do{
    //EDIT HERE and specify your field name that is primary key
    $adid_array[] = $row['username'];
    }while( 
    $rowmysql_fetch_array($numresults));
    //end foreach

    if($row_num_links_main == && $row_set_num == 0){
    $resultmsg "<p>You searched for:" $trimmed ."</p><p>No results found!</p>" ;

    }
    //delete duplicate record id's from the array. To do this we will use array_unique function
    $tmparr array_unique($adid_array);
    $i=0;
    foreach (
    $tmparr as $v) {
    $newarr[$i] = $v;
    $i++;

    this is not returning me unique values
    plz help

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Can you not use "select DISTINCT username ... " in your query?


Bookmarks

Posting Permissions

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