Missing some column names on a multiple table query

33 views Asked by At

I have two tables in MySQL taba and tabb.

I am using mysqli with PHP

The qry stmnt is $result = $this->$conn->query(select * from taba inner join tabb on colx=coly );

The rows returned are correct however I am not getting all the columns back.

In taba I have cola and colb and ALSO in tabb I have cola and colb.

$result is only returning cola and colb. I was hoping for something like taba.cola, taba.colb, tabb.cola and tabb.colb

I have a work around hack where I have renamed all the columns to Acola, Acolb in taba, Bcola, and Bcolb in tabb but surely this can't be right.

Isn't there some way of referring to these columns properly with a qualified table name.

0

There are 0 answers