fetching from join
Posted: Mon Jan 08, 2007 2:59 am
Hello,
I am trying to fetch values from two tables with the help of join statements. if the two tables are having same field name(which i am not going to use in joining). how to differeciate them and get their values.
I am getting the wrong values.
tbl1 and tbl2 contains field name enableFlag.
i want to get tbl1 enableFlag value and also tbl2 enableFlag. How to do this?
Thanx
I am trying to fetch values from two tables with the help of join statements. if the two tables are having same field name(which i am not going to use in joining). how to differeciate them and get their values.
I am getting the wrong values.
Code: Select all
$query=mysql_query("SELECT * FROM tbl1, tbl2 WHERE tbl1.id=tbl2.id");
while($r=mysql_fetch_array($query))
{
$fetch[]=$r;
}i want to get tbl1 enableFlag value and also tbl2 enableFlag. How to do this?
Thanx