成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導航首頁 ? 技術教程 ? PHP:pg_send_prepare()的用法_PostgreSQL函數
全站頭部文字 我要出現在這里
PHP:pg_send_prepare()的用法_PostgreSQL函數 782 2023-12-12   

pg_send_prepare

(PHP 5 >= 5.1.0)

pg_send_prepare — Sends a request to create a prepared statement with the given parameters, without waiting for completion.

說明

bool pg_send_prepare ( resource $connection , string $stmtname , string $query )

Sends a request to create a prepared statement with the given parameters, without waiting for completion.

This is an asynchronous version of pg_prepare(): it returns TRUE if it was able to dispatch the request, and FALSE if not. After a successful call, call pg_get_result() to determine whether the server successfully created the prepared statement. The function's parameters are handled identically to pg_prepare(). Like pg_prepare(), it will not work on pre-7.4 versions of PostgreSQL.

參數

connection

PostgreSQL database connection resource. When connection is not present, the default connection is used. The default connection is the last connection made by pg_connect() or pg_pconnect().

stmtname

The name to give the prepared statement. Must be unique per-connection. If "" is specified, then an unnamed statement is created, overwriting any previously defined unnamed statement.

query

The 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.

返回值

Returns TRUE on success, FALSE on failure. Use pg_get_result() to determine the query result.

范例

Example #1 Using pg_send_prepare()

<?php
  $dbconn = pg_connect("dbname=publisher") or die("Could not connect");

  // Prepare a query for execution
  if (!pg_connection_busy($dbconn)) {
    pg_send_prepare($dbconn, "my_query", 'SELECT * FROM shops WHERE name = $1');
    $res1 = pg_get_result($dbconn);
  }

  // Execute the prepared query.  Note that it is not necessary to escape
  // the string "Joe's Widgets" in any way
  if (!pg_connection_busy($dbconn)) {
    pg_send_execute($dbconn, "my_query", array("Joe's Widgets"));
    $res2 = pg_get_result($dbconn);
  }
  
  // Execute the same prepared query, this time with a different parameter
  if (!pg_connection_busy($dbconn)) {
    pg_send_execute($dbconn, "my_query", array("Clothes Clothes Clothes"));
    $res3 = pg_get_result($dbconn);
  }
  
?>

參見

pg_connect() - 打開一個 PostgreSQL 連接 pg_pconnect() - 打開一個持久的 PostgreSQL 連接 pg_execute() - Sends a request to execute a prepared statement with given parameters, and waits for the result. pg_send_execute() - Sends a request to execute a prepared statement with given parameters, without waiting for the result(s). pg_send_query_params() - Submits a command and separate parameters to the server without waiting for the result(s).


主站蜘蛛池模板: 廖凡和莫小棋主演的一半火焰一半海水 | 性女贞德| 爱情和战争| 故乡别来无恙演员表名单| 胃疼呕吐视频实拍| 男插女曲| 原创视频| www.douyin.com官网| 麻花影业| 都市频道在线直播观看| 又造句二年级上册| 小城故事多歌曲原唱| 关于想象的作文| 巨乳欧美| 囚禁空姐| 家庭琐事电影| 杨东波| 免费观看电影网| 蜘蛛侠三| 公共安全教育第一课| 金太狼的幸福生活电影演员表介绍| 十三邀第八季在线观看| 你迷上我 电视剧| 暗潮危机电影完整版在线观看 | 在线免费电影观看| 红缨是什么意思| 台湾电视台| 少年歌行电视剧演员表| 李彦萱| 秀人网嫩模私拍大尺度| 潜龙轰天 电影| 夫妻情感生活| 霹雳俏娇娃| 西藏卫视节目单| 工会基层组织选举工作条例| 朋友的女朋友电影| 古天乐电影大全| 你一定要幸福 电视剧| 男操男视频网站| 胡慧中电影| 拔萝卜电影|

!!!站長長期在線接!!!

網站、小程序:定制開發/二次開發/仿制開發等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103