PHP Velho Oeste 2025

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()

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

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top