1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help me in fetching records.

Discussion in 'PHP' started by Om ji Kesharwani, Dec 30, 2010.

  1. #1
    $result=mysql_query("SELECT a.*,b.* FROM signup_form a JOIN user_relationships b ON a.id = b.friend_id");

    while($row=mysql_fetch_array($result))
    {
    echo $row['f_name']." ".$row['f_name']."<br/>";
    }


    Problem is both the table is having f_name column but the value is different and when i fetch the record it shows only the value from left table .

    echo $row['f_name']." ".$row['f_name']."<br/>";

    How to differentiate the the above two values?
     
    Om ji Kesharwani, Dec 30, 2010 IP
  2. drctaccess

    drctaccess Peon

    Messages:
    62
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Use aliases like

    SELECT a.f_name AS first_f_name, b.f_name AS second_f_name ... etc
     
    drctaccess, Dec 30, 2010 IP