array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'it', ), '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 Funzioni', ), '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

Avviso

Questa enstensione deprecata da PHP 5.5.0, e sarà rimossa in futuro. Al suo posto, usare l'estensione MySQLi o PDO_MySQL. Vedere anche la guida MySQL: scelta dell'API e le FAQ relative per ulteriori informazioni. Le alternative a questa funzione includono:

Descrizione

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

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

Elenco dei parametri

result

The risultato resource che che viene calcolato. Questo risultato deriva dal una chiamata a mysql_query().

field_offset

L'offset numerico dei campi. field_offset inizia da 0. Se field_offset non esiste, viene generato un errore di livello E_WARNING.

Valori restituiti

The name of the table on success.

Esempi

Example #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";
}

?>

Note

Nota:

Per la compatibilità all'indietro, i seguenti sinonimi (deprecati) possono essere utilizzati: mysql_fieldtable()

Vedere anche: