I have this consult and I need the key names of the array I'm obtaining:
SELECT table_1.*, table_2.* FROM... INNER JOIN...
I checked other posts with similar titles and the solution is always to use an alias. This won't work for me because I have too many fields and it would be troublesome to write down every single one.
The problem is, of course, that the field names are the same in both tables.
It wouldn't be a problem if I could simply echo $arr["table_1.field_name"] but it doesn't work.
Yes, I could use the index, like $arr[0], $arr[1], $arr[2]. But if I change the table fields order or add new fields then I'll have to change it in the program and it does not seem like a proper solution either.
Thank you very much in advance.
I have too many fieldsToo many fields is symptomatic of poor design and/or laziness.$row? Then you see what the columns are called, and you get the values straight out of it.