位置: 编程技术 - 正文

PHP:pg_execute()的用法_PostgreSQL函数

发布时间:2024-01-01
pg_execute

推荐整理分享PHP:pg_execute()的用法_PostgreSQL函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5 >= 5.1.0)

pg_execute — Sends a request to execute a prepared statement with given parameters, and waits for the result.

说明 resource pg_execute ([ resource $connection ], string $stmtname , array $params )

Sends a request to execute a prepared statement with given parameters, and waits for the result.

pg_execute() is like pg_query_params(), but the command to be executed is specified by naming a previously-prepared statement, instead of giving a query string. This feature allows commands that will be used repeatedly to be parsed and planned just once, rather than each time they are executed. The statement must have been prepared previously in the current session. pg_execute() is supported only against PostgreSQL 7.4 or higher connections; it will fail when using earlier versions.

The parameters are identical to pg_query_params(), except that the name of a prepared statement is given instead of a query string.

参数

connection PHP:pg_execute()的用法_PostgreSQL函数

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 of the prepared statement to execute. if "" is specified, then the unnamed statement is executed. The name must have been previously prepared using pg_prepare(), pg_send_prepare() or a PREPARE SQL command.

params

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

Warning

Elements are converted to strings by calling this function.

返回值

A query result resource on success 或者在失败时返回 FALSE.

范例

Example #1 Using pg_execute()

<?php//Connecttoadatabasenamed"mary"$dbconn=pg_connect("dbname=mary");//Prepareaqueryforexecution$result=pg_prepare($dbconn,"my_query",'SELECT*FROMshopsWHEREname=$1');//Executethepreparedquery.Notethatitisnotnecessarytoescape//thestring"Joe'sWidgets"inanyway$result=pg_execute($dbconn,"my_query",array("Joe'sWidgets"));//Executethesamepreparedquery,thistimewithadifferentparameter$result=pg_execute($dbconn,"my_query",array("ClothesClothesClothes"));?>

参见

pg_prepare() - Submits a request to create a prepared statement with the given parameters, and waits for completion. pg_send_prepare() - Sends a request to create a prepared statement with the given parameters, without waiting for completion. pg_query_params() - Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text.

PHP:pg_delete()的用法_PostgreSQL函数 pg_delete(PHP4=4.3.0,PHP5)pg_delete删除记录说明mixedpg_delete(resource$connection,string$table_name,array$assoc_array[,int$options=PGSQL_DML_EXEC])pg_delete()删除符合条件的记录,条件

PHP:pg_escape_bytea()的用法_PostgreSQL函数 pg_escape_bytea(PHP4=4.2.0,PHP5)pg_escape_bytea转义bytea类型的二进制数据说明stringpg_escape_bytea(string$data)pg_escape_bytea()转义bytea数据类型的二进制字符串,返回转义

PHP:pg_end_copy()的用法_PostgreSQL函数 pg_end_copy(PHP4=4.0.3,PHP5)pg_end_copy与PostgreSQL后端同步说明boolpg_end_copy([resource$connection])pg_end_copy()在处理完pg_put_line()所执行的拷贝操作之后将PostgreSQL前端(

标签: PHP:pg_execute()的用法_PostgreSQL函数

本文链接地址:https://www.jiuchutong.com/biancheng/281503.html 转载请保留说明!

上一篇:PHP:pg_fetch_all_columns()的用法_PostgreSQL函数

下一篇:PHP:pg_delete()的用法_PostgreSQL函数(php destruct)

  • 旧面包车能跑长途吗
  • 年终奖怎么计税的
  • 全年一次性奖金税收优惠政策
  • 工商年报中的资金数额怎么填
  • 自动售货机进货渠道
  • 待摊费用和无形资产摊销
  • 金税盘维护费全额抵扣吗
  • 季度30万免增值税什么时候结束
  • 房产报废手续
  • 汇算清缴产生的企业所得税如何做账
  • 企业股利分配政策有哪些
  • 房地产企业借款费用
  • 核算科目拨出专票怎么弄
  • 出口退回的增值税计入哪个会计科目
  • 外贸企业免税收入怎么申报
  • 投资性房地产房租计入什么会计科目
  • 投资公司收到的发票
  • 水利事业单位基建并账分录怎么写?
  • 金税盘当月买当月不抵扣怎么处理?
  • 享受高新技术企业优惠的条件之一
  • 怎么查询发票是否已认证
  • 购买不需安装的生产设备会计分录
  • 营业成本包括哪些会计科目
  • 代收代缴水电费能开发票吗
  • 认证费计入什么科目
  • 工资结算天数
  • 工程出差主要是做什么
  • kb5001028补丁
  • 保险费做什么会计分录
  • 冲暂估成本会计分录怎么做
  • 事业单位个人借款未还违反什么规定
  • 未开票收入跨年可以冲回吗
  • cmos密码和bios密码
  • remind32.exe - remind32是什么进程 有什么用
  • navione.exe是什么意思
  • 日记账登记错了怎么办
  • 公积金托收怎么变更
  • PHP:session_cache_limiter()的用法_Session函数
  • 借支单还款后借支单要还么
  • u盘突然被写保护是坏了吗
  • 财务如何核对会计信息
  • 六自由度机器人简图
  • 代码简单图案
  • 开发成本属于什么类型科目
  • zabbix 执行命令
  • thinkphp和php
  • php导出表格
  • 研发的无形资产
  • 职工食堂费用计入什么科目
  • 汽车年审检测费收费标准
  • 小规模工程服务开票几个点
  • 会计计入其他业务收入的有哪些
  • 汇算清缴交税怎么做账务处理
  • 所得税费用是属于费用类吗
  • 企业应缴纳税款
  • 印花税不减免
  • PostgreSQL教程(十):性能提升技巧
  • 递延收益的摊销时点
  • 坏账准备怎么结转到本年利润
  • 房地产会计分录怎么做
  • 定期定额户不能用专票
  • 食堂辅助账的账务处理
  • 评估价计入什么科目
  • 独立法人的全资子公司
  • 收到党支部经费如何做账
  • 员工提前预支工资合法吗
  • 办公用品怎么开大额发票
  • sql2005定时备份数据库
  • navicate创建存储过程
  • linux中使用fdisk命令进行硬盘分区
  • u盘安装win8系统教程
  • win8如何卸载360安全卫士?
  • ubuntu创建新用户并增加管理员权限
  • node.js创建服务
  • nodejs常用内置模块
  • android 开发 教程
  • 关于Colloder事件
  • jquery数组的方法
  • 11%税率的范围
  • 河南省土地使用税税率
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号