On Thursday 04 July 2002 17:23, Wilbert Enserink wrote: > Hi all, > > > I have to tables A and B. > They boyh have a column with the same name. > > Now, I wrote this MySQL statement performing a left join. > This results in a data set with rows consisting of 2 columns of the same > name, in which the date is stored when the record was last altered. This > column is called "last_altered". > > Later on in my script I'm calling the value of this column with php. > $query="select * from tblA LEFT JOIN ...."; > $resultID=mysql_query($query); > while ($result_row=mysql_fetch_array($resultID)) > { > echo "$result_row[column with the same name]"; > } > > Well, this works without any php or mysql errors, but it is giving me the > data back of that column wich I don't wanna have...It returns the > "last_altered" date of tblB in stead of tblA. A solution might be te > exclude the second column (the wrong one) from the select statement in the > query. This is a MySQL adjustement. Anybody knows how this can be done??
Try to limit your select statement, instead of SELECT *, use SELECT colA, colB, tablA.samenamecolA, tablB.samenamecolA, etc -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Love is the process of my leading you gently back to yourself. -- Saint Exupery */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php