Name
mysql_field_table
Synopsis
string mysql_field_table(qresourcequery
, intattribute
)
Returns
the name of the table that contains the specified attribute. The
first parameter is a query
resource handle
returned from a prior call to mysql_query(
)
,
mysql_list_fields(
)
, or
mysql_unbuffered_query(
)
. The second argument is the ordinal number of the
attribute
in the SQL query, where zero
refers to the first attribute.
Example
<?php $query = "SELECT * FROM presents, people WHERE presents.people_id = people.people_id"; $connection = mysql_connect("localhost", "fred", "shhh"); mysql_select_db("wedding", $connection); $result = mysql_query($query, $connection); echo "The table associated with the first attribute is " . mysql_field_table($result, 1); ?>
Get Managing & Using MySQL, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.