2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2007-10-19 12:05:59 +00:00
|
|
|
<!-- $Revision: 1.9 $ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.mysql-field-table" xmlns="http://docbook.org/ns/docbook">
|
2005-03-30 04:07:29 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>mysql_field_table</refname>
|
2005-03-31 07:47:25 +00:00
|
|
|
<refpurpose>Get name of the table the specified field is in</refpurpose>
|
2005-03-30 04:07:29 +00:00
|
|
|
</refnamediv>
|
2005-03-31 07:47:25 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2005-03-30 06:27:14 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>string</type><methodname>mysql_field_table</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
|
|
|
<methodparam><type>int</type><parameter>field_offset</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
2005-03-31 07:47:25 +00:00
|
|
|
Returns the name of the table that the specified field is in.
|
2005-03-30 04:07:29 +00:00
|
|
|
</para>
|
2005-03-31 07:47:25 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
&mysql.result.description;
|
|
|
|
&mysql.field-offset.req.description;
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
The name of the table on success.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>A <function>mysql_field_table</function> example</title>
|
|
|
|
<programlisting role="php">
|
2004-07-14 21:08:10 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2007-10-19 12:05:59 +00:00
|
|
|
|
|
|
|
$query = "SELECT account.*, country.* FROM account, country WHERE country.name = 'Portugal' AND account.country_id = country.id";
|
|
|
|
|
|
|
|
// get the result from the DB
|
|
|
|
$result = mysql_query($query);
|
|
|
|
|
|
|
|
// Lists the table name and then the field name
|
|
|
|
for ($i = 0; $i < mysql_num_fields($result); ++$i) {
|
|
|
|
$table = mysql_field_table($result, $i);
|
|
|
|
$field = mysql_field_name($result, $i);
|
|
|
|
|
|
|
|
echo "$table: $field\n";
|
2004-07-14 21:08:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
]]>
|
2005-03-30 04:07:29 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2005-03-31 07:47:25 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
&info.deprecated.alias;
|
|
|
|
<function>mysql_fieldtable</function>
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
2005-03-31 07:47:25 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>mysql_list_tables</function></member>
|
|
|
|
</simplelist>
|
2005-03-30 04:07:29 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|