位置: 编程技术 - 正文
推荐整理分享PHP:pg_send_query_params()的用法_PostgreSQL函数,希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 5 >= 5.1.0)
pg_send_query_params — Submits a command and separate parameters to the server without waiting for the result(s).
说明 bool pg_send_query_params ( resource $connection , string $query , array $params )Submits a command and separate parameters to the server without waiting for the result(s).
This is equivalent to pg_send_query() except that query parameters can be specified separately from the query string. The functions parameters are handled identically to pg_query_params(). Like pg_query_params(), it will not work on pre-7.4 PostgreSQL connections, and it allows only one command in the query string.
参数connection
PostgreSQL database connection resource.
queryThe parameterized SQL statement. Must contain only a single statement. (multiple statements separated by semi-colons are not allowed.) If any parameters are used, they are referred to as $1, $2, etc.
paramsAn array of parameter values to substitute for the $1, $2, etc. placeholders in the original prepared query string. The number of elements in the array must match the number of placeholders.
返回值成功时返回 TRUE, 或者在失败时返回 FALSE。
Use pg_get_result() to determine the query result.
范例
Example #1 Using pg_send_query_params()
<?php$dbconn=pg_connect("dbname=publisher")ordie("Couldnotconnect");//Usingparameters.Notethatitisnotnecessarytoquoteorescape//theparameter.pg_send_query_params($dbconn,'selectcount(*)fromauthorswherecity=$1',array('Perth'));//Compareagainstbasicpg_send_queryusage$str=pg_escape_string('Perth');pg_send_query($dbconn,"selectcount(*)fromauthorswherecity='${str}'");?> 参见pg_send_query() - 发送异步查询
PHP:pg_send_prepare()的用法_PostgreSQL函数 pg_send_prepare(PHP5=5.1.0)pg_send_prepareSendsarequesttocreateapreparedstatementwiththegivenparameters,withoutwaitingforcompletion.说明boolpg_send_prepare(resource$connection,string$stmtname,string
PHP:pg_send_execute()的用法_PostgreSQL函数 pg_send_execute(PHP5=5.1.0)pg_send_executeSendsarequesttoexecuteapreparedstatementwithgivenparameters,withoutwaitingfortheresult(s).说明boolpg_send_execute(resource$connection,string$stmtname,array$
PHP:pg_select()的用法_PostgreSQL函数 pg_select(PHP4=4.3.0,PHP5)pg_select选择记录说明mixedpg_select(resource$connection,string$table_name,array$assoc_array[,int$options=PGSQL_DML_EXEC])pg_select()根据assoc_array数组中的field=v
标签: PHP:pg_send_query_params()的用法_PostgreSQL函数
本文链接地址:https://www.jiuchutong.com/biancheng/281446.html 转载请保留说明!友情链接: 武汉网站建设