WARNING - DB & PHP INTERNALS DISCUSSION. I have not worked on nor am I completely sure that this is accurate... but here's how I think PHP and the MySQL functions work. PHP builds a query string and passes it to MySQL via 'mysql_query', which dutifully executes it and returns certain results (e.g. number of rows fetched, whether it was successful or not, and accompanying error messages). I'm pretty sure it doesn't return any data or column names until you start fetching it. Given the fact that the function 'mysql_free_result' exists... it seems as though MySQL stores the results in a temporary, invisible table. The only way that you can access the data (or a lack thereof, column names included)... is to perform a fetch - of course after checking for errors and to see if any rows have been returned. PHP then shoves things into an array (e.g. key => value) and returns them to you. Larr. --- In php-objects@xxxxxxxxxxxxxxx, "Daniel Israel" <dan@...> wrote: > > It's a good trick, but it doesn't exactly answer my question. The query may > (or may not) have all the columns in the table and it may have columns from > several tables. > > -D. Israel > dan@... > http://www.customcodebydan.com > AIM: JudoDanIzz >