Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 2870

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get db name from results of cubrid_list_dbs</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.cubrid-data-seek.html">cubrid_data_seek</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.cubrid-errno.html">cubrid_errno</a></div>
 <div class="up"><a href="cubridmysql.cubrid.html">CUBRID MySQL Compatibility Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.cubrid-db-name" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">cubrid_db_name</h1>
  <p class="verinfo">(PECL CUBRID &gt;= 8.3.1)</p><p class="refpurpose"><span class="refname">cubrid_db_name</span> &mdash; <span class="dc-title">Get db name from results of cubrid_list_dbs</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.cubrid-db-name-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>cubrid_db_name</strong></span>
    ( <span class="methodparam"><span class="type">array</span> <code class="parameter">$result</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$index</code></span>
   )</div>

  <p class="para rdfs-comment">
   Retrieve the database name from a call to <span class="function"><a href="function.cubrid-list-dbs.html" class="function">cubrid_list_dbs()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.cubrid-db-name-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">result</code></dt>

     <dd>

      <p class="para">
       The result pointer from a call to <span class="function"><a href="function.cubrid-list-dbs.html" class="function">cubrid_list_dbs()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">index</code></dt>

     <dd>

      <p class="para">
       The index into the result set.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.cubrid-db-name-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the database name on success, and <strong><code>FALSE</code></strong> on failure. If <strong><code>FALSE</code></strong>
   is returned, use <span class="function"><a href="function.cubrid-error.html" class="function">cubrid_error()</a></span> to determine the nature
   of the error.
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.cubrid-db-name-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1190">
    <p><strong>Example #1 <span class="function"><strong>cubrid_db_name()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />error_reporting</span><span style="color: #007700">(</span><span style="color: #0000BB">E_ALL</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">33000</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'demodb'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'dba'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$db_list&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_list_dbs</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$cnt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$db_list</span><span style="color: #007700">);<br />while&nbsp;(</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">$cnt</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">cubrid_db_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$db_list</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">++;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

     <div class="example-contents"><p>The above example will output:</p></div>
     <div class="example-contents screen">
<div class="cdata"><pre>
demodb
</pre></div>
     </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.cubrid-db-name-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.cubrid-list-dbs.html" class="function" rel="rdfs-seeAlso">cubrid_list_dbs()</a> - Return an array with the list of all existing CUBRID databases</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.cubrid-data-seek.html">cubrid_data_seek</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.cubrid-errno.html">cubrid_errno</a></div>
 <div class="up"><a href="cubridmysql.cubrid.html">CUBRID MySQL Compatibility Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>