<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.mysql-tablename.php',
    1 => 'mysql_tablename',
    2 => 'Get table name of field',
  ),
  'up' => 
  array (
    0 => 'ref.mysql.php',
    1 => 'MySQL Функції',
  ),
  '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">Увага</strong>
   <p class="para">Це розширення застаріле, починаючи
з PHP 5.5.0, та вилучене з PHP 7.0.0. Натомість використовуються розширення
<a href="book.mysqli.php" class="link">MySQLi</a> або
<a href="ref.pdo-mysql.php" class="link">PDO_MySQL</a>. Докладніше описано у керівництві
<a href="mysqlinfo.api.choosing.php" class="link">MySQL: вибір API</a>.
Цю функцію можна замінити на:</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">Опис</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="para rdfs-comment">
   Retrieves the table name from a <code class="parameter">result</code>.
  </p>
  <p class="para">
   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">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">result</code></dt>
     <dd>
      <p class="para">
       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>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">i</code></dt>
     <dd>
      <p class="para">
       The integer index (row/table number)
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mysql-tablename-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   The name of the table on success або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
  <p class="para">
   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">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #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>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.mysql-tablename-notes">
  <h3 class="title">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    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.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mysql-tablename-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <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>
  </p>
 </div>

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