<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >odbc_execute</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="ODBC Functions (Unified)" HREF="ref.uodbc.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=UTF-8"></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 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.odbc-exec.html" ACCESSKEY="P" >上一页</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" >下一页</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="AEN160681" ></A ><P > (PHP 3 >= 3.0.6, PHP 4, PHP 5)</P >odbc_execute -- Execute a prepared statement</DIV ><DIV CLASS="refsect1" ><A NAME="AEN160684" ></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 >.如果成功则返回 <TT CLASS="constant" ><B >TRUE</B ></TT >,失败则返回 <TT CLASS="constant" ><B >FALSE</B ></TT >。 The array <CODE CLASS="parameter" >parameters_array</CODE > only needs to be given if you really have parameters in your statement. </P ><P > Parameters in <CODE CLASS="parameter" >parameter_array</CODE > will be substituted for placeholders in the prepared statement in order. Elements of this array will be converted to strings by calling this function. </P ><P > Any parameters in <CODE CLASS="parameter" >parameter_array</CODE > 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 >注意: </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#ini.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 add a space or other non-single-quote character to the beginning or end of the parameter, which will prevent the parameter from 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" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.odbc-fetch-array.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >odbc_exec</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.uodbc.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >odbc_fetch_array</TD ></TR ></TABLE ></DIV ></BODY ></HTML >