Home > database >  Consult mysql under a great god, the same field of two table league table after the search, how to u
Consult mysql under a great god, the same field of two table league table after the search, how to u

Time:02-20

PHP + mysql

Table 1
Id xm1 xm2 xm3


Table 2
Id xm1 xm2 xm3


$rs=mysql_query (" SELECT * from a, b1, b2 b where Anderson, d=b.x m3 ");
While ($rows=mysql_fetch_array ($rs)) {

Echo $rows [" a.x m3 "];//error demo
Echo $rows [" b.x m3 "];//error demo

}

Without an alias SELECT a.x m3 as qq, b.x m3 as ww
Also need not array echo $rows [3]. Echo $rows [7].

CodePudding user response:

Why we use alias is the best solution, that is, no?

CodePudding user response:

reference 1st floor chengangcsdn response:
why we use alias is the best solution, which need not?

Because in practice there are a lot of the same name field, there are about 40 or so, one by one with an alias is too much trouble
  • Related