<HTML ><HEAD ><TITLE >odbc_execute</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Unified ODBC functions" HREF="ref.odbc.html"><LINK REL="PREVIOUS" TITLE="odbc_exec" HREF="function.odbc-exec.html"><LINK REL="NEXT" TITLE="odbc_fetch_array" HREF="function.odbc-fetch-array.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.odbc-exec.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.odbc-fetch-array.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.odbc-execute" ></A >odbc_execute</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN65058" ></A ><P > (PHP 3>= 3.0.6, PHP 4 )</P >odbc_execute -- Execute a prepared statement</DIV ><DIV CLASS="refsect1" ><A NAME="AEN65061" ></A ><H2 >Description</H2 >bool <B CLASS="methodname" >odbc_execute</B > ( resource result_id [, array parameters_array])<BR ></BR ><P > Executes a statement prepared with <A HREF="function.odbc-prepare.html" ><B CLASS="function" >odbc_prepare()</B ></A >.Returns <TT CLASS="constant" ><B >TRUE</B ></TT > on success or <TT CLASS="constant" ><B >FALSE</B ></TT > on failure. The array <TT CLASS="parameter" ><I >parameters_array</I ></TT > only needs to be given if you really have parameters in your statement. </P ><P > Parameters in <TT CLASS="parameter" ><I >parameter_array</I ></TT > will be substituted for placeholders in the prepared statement in order. </P ><P > Any parameters in <TT CLASS="parameter" ><I >parameter_array</I ></TT > which start and end with single quotes will be taken as the name of a file to read and send to the database server as the data for the appropriate placeholder. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > As of PHP 4.1.1, this file reading functionality has the following restrictions: <P ></P ><UL ><LI ><P > File reading is <SPAN CLASS="emphasis" ><I CLASS="emphasis" >not</I ></SPAN > subject to any <A HREF="features.safe-mode.html" >safe mode</A > or <A HREF="features.safe-mode.html#ini.open-basedir" >open-basedir</A > restrictions. This is fixed in PHP 4.2.0. </P ></LI ><LI ><P > <A HREF="features.remote-files.html" >Remote files</A > are not supported. </P ></LI ><LI ><P > If you wish to store a string which actually begins and ends with single quotes, you must escape them or add a space or other non-single-quote character to the beginning or end of the parameter, which will prevent the parameter's being taken as a file name. If this is not an option, then you must use another mechanism to store the string, such as executing the query directly with <A HREF="function.odbc-exec.html" ><B CLASS="function" >odbc_exec()</B ></A >). </P ></LI ></UL > </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.odbc-exec.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.odbc-fetch-array.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >odbc_exec</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.odbc.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >odbc_fetch_array</TD ></TR ></TABLE ></DIV ></BODY ></HTML >