zoukankan      html  css  js  c++  java
  • [PHP]PDO各方法在发生MYSQL断开时的反应

    1.mixed PDO::errorCode ( void )

    如果单独执行此语句,并不能判断此时MYSQL是否已断开,它返回最上一次对MYSQL操作的错误码

    2.public array PDO::errorInfo ( void )

    如果单独执行此语句,并不能判断此时MYSQL是否已断开,它返回最上一次对MYSQL操作的错误信息

    3.bool PDO::beginTransaction ( void )

    发出一个Warning级报错,(当当前环境已经开启了事务,再调用此方法会抛出PDOException,当然这已经不是在此话题讨论之列)

    4.bool PDO::commit ( void )

    抛出PDOException

    5.int PDO::exec ( string $statement )

    发出一个Warning级报错

    6.mixed PDO::getAttribute ( int $attribute )

    一旦连接上MYSQL,便不需要依靠连接就可以返回内容,所以对MYSQL的中途断开无感知

    7.string PDO::lastInsertId ([ string $name = NULL ] )

    一旦连接上MYSQL,便不需要依靠连接就可以返回内容,所以对MYSQL的中途断开无感知

    8.public PDOStatement PDO::prepare ( string $statement [, array $driver_options = array() ] )

    一旦连接上MYSQL,便不需要依靠连接就可以返回内容,所以对MYSQL的中途断开无感知

    9.public PDOStatement PDO::query ( string $statement )

    发出一个Warning级报错

    10.bool PDO::rollBack ( void )

    抛出PDOException

    11.bool PDOStatement::bindValue ( mixed $parameter , mixed $value [, int $data_type = PDO::PARAM_STR ] )

    一旦连接上MYSQL,便不需要依靠连接就可以返回内容,所以对MYSQL的中途断开无感知

    12.bool PDOStatement::execute ([ array $input_parameters ] )

    发出一个Warning级报错

  • 相关阅读:
    python 赋值操作的知识点
    python while循环语句
    python dict遍历
    python列表的切片操作
    Python做下载器需要掌握哪些
    BeautifulSoup已经安装,但仍提示No module named
    python 列表循环输出中文
    python 字符串split (string split)
    python 调用解释器
    分享python字符串去除空格的知识点
  • 原文地址:https://www.cnblogs.com/yiyide266/p/8093570.html
Copyright © 2011-2022 走看看