<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mysqli-sql-exception.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'mysqli-sql-exception.getsqlstate.php',
    1 => 'mysqli_sql_exception::getSqlState',
    2 => 'Returns the SQLSTATE error code',
  ),
  'up' => 
  array (
    0 => 'class.mysqli-sql-exception.php',
    1 => 'mysqli_sql_exception',
  ),
  'prev' => 
  array (
    0 => 'class.mysqli-sql-exception.php',
    1 => 'mysqli_sql_exception',
  ),
  'next' => 
  array (
    0 => 'ref.mysqli.php',
    1 => '别名和过时的 Mysqli 函数',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mysqli/mysqli_sql_exception/getsqlstate.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mysqli-sql-exception.getsqlstate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysqli_sql_exception::getSqlState</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.1.2)</p><p class="refpurpose"><span class="refname">mysqli_sql_exception::getSqlState</span> &mdash; <span class="dc-title">Returns the SQLSTATE error code</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysqli-sql-exception.getsqlstate-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>mysqli_sql_exception::getSqlState</strong></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Returns a string containing the SQLSTATE error code for the last error.
   The error code consists of five characters.
   The values are specified by ANSI SQL and ODBC. For a list of possible values, see
   <a href="http://dev.mysql.com/doc/mysql/en/error-handling.html" class="link external">&raquo;&nbsp;http://dev.mysql.com/doc/mysql/en/error-handling.html</a>.
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    Note that not all MySQL errors are yet mapped to SQLSTATE&#039;s.
    The value <code class="literal">HY000</code> (general error) is used for unmapped errors.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysqli-sql-exception.getsqlstate-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mysqli-sql-exception.getsqlstate-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters.
  </p>
 </div>

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