array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.mysql-field-table.php', 1 => 'mysql_field_table', 2 => 'Get name of the table the specified field is in', ), 'up' => array ( 0 => 'ref.mysql.php', 1 => 'MySQL Функції', ), 'prev' => array ( 0 => 'function.mysql-field-seek.php', 1 => 'mysql_field_seek', ), 'next' => array ( 0 => 'function.mysql-field-type.php', 1 => 'mysql_field_type', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mysql/functions/mysql-field-table.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

mysql_field_table

(PHP 4, PHP 5)

mysql_field_tableGet name of the table the specified field is in

Увага

Це розширення застаріле, починаючи з PHP 5.5.0, та вилучене з PHP 7.0.0. Натомість використовуються розширення MySQLi або PDO_MySQL. Докладніше описано у керівництві MySQL: вибір API. Цю функцію можна замінити на:

Опис

mysql_field_table(resource $result, int $field_offset): string

Returns the name of the table that the specified field is in.

Параметри

result

Результат типу resource для опрацювання, якого повертає функція mysql_query().

field_offset

Числовий зсув поля. Значення field_offset починається з 0. Якщо зсуву field_offset не існує, буде виведено повідомлення рівня E_WARNING.

Значення, що повертаються

The name of the table on success.

Приклади

Приклад #1 A mysql_field_table() example

<?php

$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";
}

?>

Примітки

Зауваження:

Для зворотньої сумісності, можна використовувати такий застарілий псевдонім: mysql_fieldtable()

Прогляньте також