(PHP 4, PHP 5)
mysql_field_table — Get name of the table the specified field is in
Це розширення застаріле, починаючи з PHP 5.5.0, та вилучене з PHP 7.0.0. Натомість використовуються розширення MySQLi або PDO_MySQL. Докладніше описано у керівництві MySQL: вибір API. Цю функцію можна замінити на:
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()