I have the following query:
SELECT *
FROM scool
LEFT JOIN people as t1 ON t1.scool_fk=scool.id AND t1.lang_gk='en'
LEFT JOIN people as t2 ON t2.scool_fk=scool.id AND t2.lang_gk='fr'
…
(this is nonsense query, only for example)
With SELECT * it query returns french values
With SELECT t1.* it query returns english values
The only possible solution i know is
SELECT t1.name as name_en, t2.name as name_fr
This don’t like me because i can’t automatize the selects in my program
Is possible to be return all values from SELECT with tablename.columnname or other similar solution, for get values in php?
Use
mysql_fetch_fieldand propertiestableandname: