theKingOfTerrors
V2EX  ›  PHP

不借助框架,怎么去获取当前脚本中执行的所有 mysql 语句柄

  •  
  •   theKingOfTerrors · Jul 13, 2016 · 3474 views
    This topic created in 3765 days ago, the information mentioned may be changed or developed.

    从当前 PHP 脚本获取执行的 MySQL 语句柄

    5 replies  •  2016-07-14 13:12:44 +08:00
    hbprotoss
    hbprotoss
    Jul 13, 2016
    1
    语句柄是啥?
    yemoluo
    yemoluo
    Jul 14, 2016
    2
    用一个函数把 mysql_connnect 包裹起来,每连接一次就纪录一次
    yemoluo
    yemoluo
    Jul 14, 2016
    3
    @GTim 写错了是 mysql_connect
    theKingOfTerrors
    theKingOfTerrors
    OP
    Jul 14, 2016
    4
    @hbprotoss 都是 mysql 查询语句,我想获取到这些语句
    wudanyang
    wudanyang
    Jul 14, 2016
    5
    你要弄个统一的执行入口,每次执行 sql 语句之前,将 sql 语句写到 log 里面。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4848 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 01:16 · PVG 09:16 · LAX 17:16 · JFK 20:16
    ♥ Do have faith in what you're doing.