php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36378 mysql_field_table doesn't work with JOIN's
Submitted: 2006-02-13 15:17 UTC Modified: 2006-02-13 16:36 UTC
From: troels at kyberfabrikken dot dk Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.4.2 OS: winxp
Private report: No CVE-ID: None
 [2006-02-13 15:17 UTC] troels at kyberfabrikken dot dk
Description:
------------
This function only returns the name of the first table when you use a JOIN.

Reproduce code:
---------------
For example with the query below the table name would be table1 for all fields:

SELECT table1.*, table2.this_thing, table3.that_thing FROM table1 LEFT JOIN table2 ON table1.tb2_id = table2.id LEFT JOIN table3 ON table1.tb3_id = table3.id

Expected result:
----------------
The expected behaviour would be, that the table name for the field this_thing is table2 and table3 for the field that_thing respectively.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-13 15:23 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-02-13 16:36 UTC] troels at kyberfabrikken dot dk
My appologies - This problem seems to have been fixed- Copied the text from the comments section of http://php.net/mysql_field_table.
I wonder why it was never filed as a bug in the first place ?
Would anyone happen to know from which version this was working properly ?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 03:01:32 2024 UTC