PHP/PDO:如何获取当前连接状态 [英] PHP/PDO: How to get the current connection status

查看:39
本文介绍了PHP/PDO:如何获取当前连接状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 PDO 等价物:

What is the PDO equivalent of:

mysqli_stat($dbConn);

附:我用它来(收到消息)确保我已连接

P.S. I use it to (get a message to) make sure I am connected

推荐答案

我不能得到这个答案.有人发布了答案,但他/她后来删除了该条目.

I cannot get credit for this answer. Someone posted the answer, but he/she latter deleted the entry.

这是(已保存存档) 对您问题的回答:

Here's the (saved archived) answer to your question:

$status = $conn->getAttribute(PDO::ATTR_CONNECTION_STATUS);

这篇关于PHP/PDO:如何获取当前连接状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆