$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?