<?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-unbuffered-query.php',
    1 => 'mysql_unbuffered_query',
    2 => 'Send an SQL query to MySQL without fetching and buffering the result rows',
  ),
  'up' => 
  array (
    0 => 'ref.mysql.php',
    1 => 'MySQL Функції',
  ),
  'prev' => 
  array (
    0 => 'function.mysql-thread-id.php',
    1 => 'mysql_thread_id',
  ),
  'next' => 
  array (
    0 => 'book.mysqlnd.php',
    1 => 'Mysqlnd',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mysql/functions/mysql-unbuffered-query.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mysql-unbuffered-query" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysql_unbuffered_query</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5)</p><p class="refpurpose"><span class="refname">mysql_unbuffered_query</span> &mdash; <span class="dc-title">Send an SQL query to MySQL without fetching and buffering the result rows</span></p>

 </div>

 <div id="function.mysql-unbuffered-query-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>See: <a href="mysqlinfo.concepts.buffering.php" class="link">Buffered and Unbuffered queries</a></li>
   </ul>
  </div>
 </div>

 <div class="refsect1 description" id="refsect1-function.mysql-unbuffered-query-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mysql_unbuffered_query</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$query</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$link_identifier</code><span class="initializer"> = NULL</span></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>mysql_unbuffered_query()</strong></span> sends the SQL query
   <code class="parameter">query</code> to MySQL without automatically
   fetching and buffering the result rows as
   <span class="function"><a href="function.mysql-query.php" class="function">mysql_query()</a></span> does.  This saves a considerable
   amount of memory with SQL queries that produce large result sets,
   and you can start working on the result set immediately after the
   first row has been retrieved as you don&#039;t have to wait until the
   complete SQL query has been performed.  To use
   <span class="function"><strong>mysql_unbuffered_query()</strong></span> while multiple database
   connections are open, you must specify the optional parameter
   <code class="parameter">link_identifier</code> to identify which connection
   you want to use.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mysql-unbuffered-query-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">query</code></dt>
     <dd>
      <p class="para">
       The SQL query to execute.
      </p>
      <p class="para">
       Data inside the query should be <a href="function.mysql-real-escape-string.php" class="link">properly escaped</a>.
      </p>
     </dd>
    
    <dt>
<code class="parameter">link_identifier</code></dt><dd><p class="para">З&#039;єднання
MySQL. Якщо не задано, буде обрано останнє з&#039;єднання, встановлене функцією
<span class="function"><a href="function.mysql-connect.php" class="function">mysql_connect()</a></span>. Якщо з&#039;єднатися не вдалось, функція
спробує встановити нове, ніби викликавши функцію
<span class="function"><a href="function.mysql-connect.php" class="function">mysql_connect()</a></span> без параметрів. Якщо з&#039;єднання не
вдалося знайти або встановити, буде виведено повідомлення рівня
<strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong></p></dd>
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mysql-unbuffered-query-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   For SELECT, SHOW, DESCRIBE or EXPLAIN statements,
   <span class="function"><strong>mysql_unbuffered_query()</strong></span> 
   returns a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> on success, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on
   error.
  </p>
  <p class="para">
   For other type of SQL statements, UPDATE, DELETE, DROP, etc,
   <span class="function"><strong>mysql_unbuffered_query()</strong></span> returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success
   or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on error.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.mysql-unbuffered-query-notes">
  <h3 class="title">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    The benefits of <span class="function"><strong>mysql_unbuffered_query()</strong></span> come
    at a cost: you cannot use <span class="function"><a href="function.mysql-num-rows.php" class="function">mysql_num_rows()</a></span> and
    <span class="function"><a href="function.mysql-data-seek.php" class="function">mysql_data_seek()</a></span> on a result set returned from
    <span class="function"><strong>mysql_unbuffered_query()</strong></span>, until all rows are fetched.
    You also have to fetch all result rows from an unbuffered SQL query
    before you can send a new SQL query to MySQL, using the same
    <code class="parameter">link_identifier</code>.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mysql-unbuffered-query-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mysql-query.php" class="function" rel="rdfs-seeAlso">mysql_query()</a> - Send a MySQL query</span></li>
   </ul>
  </p>
 </div>

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