<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mysql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.mysql-tablename.php',
    1 => 'mysql_tablename',
    2 => 'Get table name of field',
  ),
  'up' => 
  array (
    0 => 'ref.mysql.php',
    1 => 'MySQL Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.mysql-stat.php',
    1 => 'mysql_stat',
  ),
  'next' => 
  array (
    0 => 'function.mysql-thread-id.php',
    1 => 'mysql_thread_id',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mysql/functions/mysql-tablename.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mysql-tablename" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysql_tablename</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">mysql_tablename</span> &mdash; <span class="dc-title">Get table name of field</span></p>

 </div>

 <div id="function.mysql-tablename-refsynopsisdiv">
  <div class="warning"><strong class="warning">Avviso</strong>
   <p class="para">Questa enstensione  deprecata da PHP 5.5.0, e sarà rimossa in futuro.
Al suo posto, usare l&#039;estensione <a href="book.mysqli.php" class="link">MySQLi</a> o <a href="ref.pdo-mysql.php" class="link">PDO_MySQL</a>.
Vedere anche la guida <a href="mysqlinfo.api.choosing.php" class="link">MySQL: scelta dell&#039;API</a> e
le <a href="faq.databases.php#faq.databases.mysql.deprecated" class="link">FAQ relative</a> per ulteriori informazioni. 
Le alternative a questa funzione includono:</p>
   <ul class="simplelist">
    <li>SQL Query: <code class="literal">SHOW TABLES</code></li>
   </ul>
  </div>
 </div>

 <div class="refsect1 description" id="refsect1-function.mysql-tablename-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mysql_tablename</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$result</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$i</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   Retrieves the table name from a <code class="parameter">result</code>.
  </p>
  <p class="simpara">
   This function is deprecated. It is preferable to use
   <span class="function"><a href="function.mysql-query.php" class="function">mysql_query()</a></span> to issue an SQL <code class="literal">SHOW TABLES
   [FROM db_name] [LIKE &#039;pattern&#039;]</code> statement instead.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mysql-tablename-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">result</code></dt>
    <dd>
     <span class="simpara">
      A result pointer <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> that&#039;s returned from
      <span class="function"><a href="function.mysql-list-tables.php" class="function">mysql_list_tables()</a></span>.
     </span>
    </dd>
   
   
    <dt><code class="parameter">i</code></dt>
    <dd>
     <span class="simpara">
      The integer index (row/table number)
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mysql-tablename-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="simpara">
   The name of the table on success o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
  </p>
  <p class="simpara">
   Use the <span class="function"><strong>mysql_tablename()</strong></span> function to
   traverse this result pointer, or any function for result tables,
   such as <span class="function"><a href="function.mysql-fetch-array.php" class="function">mysql_fetch_array()</a></span>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mysql-tablename-examples">
  <h3 class="title">Esempi</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>mysql_tablename()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />mysql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">, </span><span style="color: #DD0000">"mysql_user"</span><span style="color: #007700">, </span><span style="color: #DD0000">"mysql_password"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">mysql_list_tables</span><span style="color: #007700">(</span><span style="color: #DD0000">"mydb"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$num_rows </span><span style="color: #007700">= </span><span style="color: #0000BB">mysql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br />for (</span><span style="color: #0000BB">$i </span><span style="color: #007700">= </span><span style="color: #0000BB">0</span><span style="color: #007700">; </span><span style="color: #0000BB">$i </span><span style="color: #007700">&lt; </span><span style="color: #0000BB">$num_rows</span><span style="color: #007700">; </span><span style="color: #0000BB">$i</span><span style="color: #007700">++) {<br />    echo </span><span style="color: #DD0000">"Table: "</span><span style="color: #007700">, </span><span style="color: #0000BB">mysql_tablename</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">, </span><span style="color: #0000BB">$i</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">mysql_free_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 notes" id="refsect1-function.mysql-tablename-notes">
  <h3 class="title">Note</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    The <span class="function"><a href="function.mysql-num-rows.php" class="function">mysql_num_rows()</a></span> function may be used to
    determine the number of tables in the result pointer.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mysql-tablename-seealso">
  <h3 class="title">Vedere anche:</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.mysql-list-tables.php" class="function" rel="rdfs-seeAlso">mysql_list_tables()</a> - List tables in a MySQL database</span></li>
   <li><span class="function"><a href="function.mysql-field-table.php" class="function" rel="rdfs-seeAlso">mysql_field_table()</a> - Get name of the table the specified field is in</span></li>
   <li><span class="function"><a href="function.mysql-db-name.php" class="function" rel="rdfs-seeAlso">mysql_db_name()</a> - Retrieves database name from the call to mysql_list_dbs</span></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>