位置: 编程技术 - 正文

PHP:pg_pconnect()的用法_PostgreSQL函数(php-cp)

编辑:rootadmin
pg_pconnect

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

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

(PHP 4, PHP 5)

pg_pconnect — 打开一个持久的 PostgreSQL 连接

说明 resource pg_pconnect ( string $connection_string [, int $connect_type ] )

pg_pconnect() 打开一个到 PostgreSQL 数据库的持久连接。返回其它 PostgreSQL 函数所需要的连接资源号。

If a second call is made to pg_pconnect() with the same connection_string as an existing connection, the existing connection will be returned unless you pass PGSQL_CONNECT_FORCE_NEW as connect_type.

要打开持久连接功能,php.ini 中的 pgsql.allow_persistent 参数必须为 "On"(也是默认值)。最大持久连接数目由 php.ini 中的 pgsql.max_persistent参数定义(默认为 -1 表示没有限制)。所有连接的数目可由 php.ini 中的 pgsql.max_links 参数设置。

pg_close() 不能关闭由 pg_pconnect() 打开的持久连接。

参数 PHP:pg_pconnect()的用法_PostgreSQL函数(php-cp)

connection_string

The connection_string can be empty to use all default parameters, or it can contain one or more parameter settings separated by whitespace. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty value or a value containing spaces, surround it with single quotes, e.g., keyword = &#;a value&#;. Single quotes and backslashes within the value must be escaped with a backslash, i.e., &#; and .

The currently recognized parameter keywords are: host, hostaddr, port, dbname, user, password, connect_timeout, options, tty (ignored), sslmode, requiressl (deprecated in favor of sslmode), and service. Which of these arguments exist depends on your PostgreSQL version.

connect_type

If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection is created, even if the connection_string is identical to an existing connection.

返回值

PostgreSQL connection resource on success, FALSE on failure.

范例

Example #1 Using pg_pconnect()

<?php$dbconn=pg_pconnect("dbname=mary");//connecttoadatabasenamed"mary"$dbconn2=pg_pconnect("host=localhostport=dbname=mary");//connecttoadatabasenamed"mary"on"localhost"atport""$dbconn3=pg_pconnect("host=sheepport=dbname=maryuser=lambpassword=foo");//connecttoadatabasenamed"mary"onthehost"sheep"withausernameandpassword$conn_string="host=sheepport=dbname=testuser=lambpassword=bar";$dbconn4=pg_pconnect($conn_string);//connecttoadatabasenamed"test"onthehost"sheep"withausernameandpassword?>

参见

pg_connect() - 打开一个 PostgreSQL 连接 持久数据库连接

PHP:pg_ping()的用法_PostgreSQL函数 pg_ping(PHP4=4.3.0,PHP5)pg_pingPing数据库连接说明boolpg_ping(resource$connection)pg_ping()ping数据库连接,如果中断则尝试重新连接。如果连接在活动状态返回TRUE,否

PHP:pg_parameter_status()的用法_PostgreSQL函数 pg_parameter_status(PHP5)pg_parameter_statusLooksupacurrentparametersettingoftheserver.说明stringpg_parameter_status([resource$connection],string$param_name)Looksupacurrentparametersettingoftheserve

PHP:pg_options()的用法_PostgreSQL函数 pg_options(PHP4,PHP5)pg_options获得和连接有关的选项说明stringpg_options(resource$connection)pg_options()以字符串形式返回指定PostgreSQLconnection资源的连接选项。

标签: php-cp

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

上一篇:PHP:pg_port()的用法_PostgreSQL函数(php poll)

下一篇:PHP:pg_ping()的用法_PostgreSQL函数(php实现ping功能)

  • 延期缴税申请需要先申报吗?
  • 没进项发票的开销项发票多少税?
  • 电子发票冲红处理
  • 低值易耗品如何报废
  • 生产单位车间设计费应该计入什么科目?
  • 施工企业仪器设备入什么会计科目核算?
  • 资产的税务处理要注意什么
  • 防伪税控发票种类主要有哪些
  • 代扣代缴个税手续费返还怎么操作
  • 福利费的进项税额转出
  • 房租的应收必须交吗
  • 电子发票真伪查询
  • 增值税电子普通发票开具规定
  • 跨地区经营建筑企业预缴企业所得税
  • 一般企业利润表格式
  • 出口汇兑损益的会计分录
  • 如何解决win10系统复制文件速度
  • 工资做账表格怎么做
  • 年末资产减年初资产
  • 平板电脑的windows更新有必要吗
  • 专用发票和普通发票的报销区别
  • mac auto tune
  • 生产成本结转库存商品的数量
  • 确定注册资本的方法
  • netddeclnt.exe - netddeclnt是什么进程 有什么用
  • php://input用法
  • 销售折让双方会计分录
  • 橡皮树的养殖方法视频教程
  • 企业办理税务
  • 结转制造费用用什么科目
  • labview oop
  • 铡刀演示
  • windows history命令
  • 印花税减半征收减免性质代码
  • 哪些企业可以开13点税票
  • 开会旅游的费用怎么算
  • 增值税申报系统登录密码
  • 开出租车怎么租车
  • 事件委托js例子
  • 交易性金融资产公允价值变动计入
  • 织梦怎么添加相关
  • 汽车牌照费用是在哪里开的
  • 以土地使用权投资入股
  • 给个人的返佣如何交税
  • 小规模纳税人转让土地使用权税率
  • mysql 子查询
  • 企业为职工支付的补充医疗保险费
  • 应收账款贷方余额年末怎么处理
  • 记账凭证摘要的填制要求
  • 建筑安装业经营范围
  • 研发成功后的产品出售如何处理
  • 租赁合同的印花税的计税依据
  • 实收资本相关认定
  • 当月计提公积金下月发放怎么做分录
  • 科目余额表没有本年累计怎么办
  • ubuntu20.04
  • 微软平板电脑surface pro2参数
  • 如何修复win7系统文件损坏
  • 在linux系统中添加用户的命令
  • 电脑重装系统步奏
  • xp 关机
  • win7玩dnf总是未响应
  • u盘运行win10系统
  • win10系统如何
  • win10系统中怎么打开IE浏览器
  • opengl learn
  • 控制角色一致性的5个方法
  • js兼容ie
  • shell脚本-ge
  • div style display none
  • 自动搜索工具
  • js domcontentloaded
  • python 解析算法
  • 用javascript
  • js中数组排序sort的用法
  • 金税盘显示证书口令错误
  • 网上新办税务操作流程
  • 郑州二套房契税征收2023标准是多少
  • 亳州自来水缴费
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设