function.ifx-getsqlca.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 105 行
HTML
105 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Get the contents of sqlca.sqlerrd[0..5] after a query</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ifx-get-char.html">ifx_get_char</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ifx-htmltbl-result.html">ifx_htmltbl_result</a></div> <div class="up"><a href="ref.ifx.html">Informix Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.ifx-getsqlca" class="refentry"> <div class="refnamediv"> <h1 class="refname">ifx_getsqlca</h1> <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">ifx_getsqlca</span> — <span class="dc-title">Get the contents of sqlca.sqlerrd[0..5] after a query</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><b><b>ifx_getsqlca</b></b></span> ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$result_id</tt></span> )</div> <p class="para rdfs-comment"> Returns a pseudo-row with sqlca.sqlerrd[0] ... sqlca.sqlerrd[5] after the query associated with <i><tt class="parameter">result_id</tt></i>. </p> <p class="para"> For inserts, updates and deletes the values returned are those as set by the server after executing the query. This gives access to the number of affected rows and the serial insert value. For <i>SELECT</i>s the values are those saved after the <i>PREPARE</i> statement. This gives access to the *estimated* number of affected rows. The use of this function saves the overhead of executing a <i>SELECT dbinfo('sqlca.sqlerrdx')</i> query, as it retrieves the values that were saved by the ifx driver at the appropriate moment. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">result_id</tt></i></span> <dd> <p class="para"> <i><tt class="parameter">result_id</tt></i> is a valid result id returned by <a href="function.ifx-query.html" class="function">ifx_query()</a> or <a href="function.ifx-prepare.html" class="function">ifx_prepare()</a> (select type queries only!). </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns an associative array with the following entries: <i>sqlerrd0</i>, <i>sqlerrd1</i>, <i>sqlerrd2</i>, <i>sqlerrd3</i>, <i>sqlerrd4</i> and <i>sqlerrd5</i>. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 Retrieve Informix sqlca.sqlerrd[x] values</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">/* assume the first column of 'sometable' is a serial */<br /></span><span style="color: #0000BB">$qid </span><span style="color: #007700">= </span><span style="color: #0000BB">ifx_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"insert into sometable<br /> values (0, '2nd column', 'another column') "</span><span style="color: #007700">, </span><span style="color: #0000BB">$connid</span><span style="color: #007700">);<br />if (!</span><span style="color: #0000BB">$qid</span><span style="color: #007700">) {<br /> </span><span style="color: #FF8000">/* ... error ... */<br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">$sqlca </span><span style="color: #007700">= </span><span style="color: #0000BB">ifx_getsqlca</span><span style="color: #007700">(</span><span style="color: #0000BB">$qid</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$serial_value </span><span style="color: #007700">= </span><span style="color: #0000BB">$sqlca</span><span style="color: #007700">[</span><span style="color: #DD0000">"sqlerrd1"</span><span style="color: #007700">];<br />echo </span><span style="color: #DD0000">"The serial value of the inserted row is : $serial_value<br />\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> </div> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ifx-get-char.html">ifx_get_char</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ifx-htmltbl-result.html">ifx_htmltbl_result</a></div> <div class="up"><a href="ref.ifx.html">Informix Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?