<!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>Execute a previously prepared SQL-statement</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ifx-create-char.html">ifx_create_char</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ifx-error.html">ifx_error</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-do" class="refentry"> <div class="refnamediv"> <h1 class="refname">ifx_do</h1> <p class="verinfo">(PHP 4, PHP <=5.2.0)</p><p class="refpurpose"><span class="refname">ifx_do</span> — <span class="dc-title">Execute a previously prepared SQL-statement</span></p> </div> <div class="refsect1 description" id="refsect1-function.ifx-do-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>ifx_do</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result_id</code></span> )</div> <p class="para rdfs-comment"> Executes a previously prepared query or opens a cursor for it. </p> <p class="para"> Does NOT free <em><code class="parameter">result_id</code></em> on error. </p> <p class="para"> Also sets the real number of <span class="function"><a href="function.ifx-affected-rows.html" class="function">ifx_affected_rows()</a></span> for non-select statements for retrieval by <span class="function"><a href="function.ifx-affected-rows.html" class="function">ifx_affected_rows()</a></span>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.ifx-do-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">result_id</code></em></span> <dd> <p class="para"> <em><code class="parameter">result_id</code></em> is a valid resultid returned by <span class="function"><a href="function.ifx-query.html" class="function">ifx_query()</a></span> or <span class="function"><a href="function.ifx-prepare.html" class="function">ifx_prepare()</a></span> (select type queries only!). </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.ifx-do-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 seealso" id="refsect1-function.ifx-do-seealso"> <h3 class="title">See Also</h3> <p class="para"> <div class="example" id="example-1195"> <p><strong>Example #1 <span class="function"><strong>ifx_do()</strong></span> Example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$conn </span><span style="color: #007700">= </span><span style="color: #0000BB">fx_connect</span><span style="color: #007700">( </span><span style="color: #DD0000">"db"</span><span style="color: #007700">, </span><span style="color: #DD0000">"user"</span><span style="color: #007700">, </span><span style="color: #DD0000">"password" </span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">ifx_prepare</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT customer_num, company FROM customer"</span><span style="color: #007700">, </span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ifx_do</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-function.ifx-do-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.ifx-prepare.html" class="function" rel="rdfs-seeAlso">ifx_prepare()</a> - Prepare an SQL-statement for execution</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.ifx-create-char.html">ifx_create_char</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ifx-error.html">ifx_error</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>