silenceeeee
V2EX  ›  问与答

codeigniter 吐槽

  •  
  •   silenceeeee · Mar 14, 2017 · 2161 views
    This topic created in 3521 days ago, the information mentioned may be changed or developed.

    pdo 的连接代码如下:

    	function db_connect()
    	{
    		$this->options['PDO::ATTR_ERRMODE'] = PDO::ERRMODE_SILENT;
    		return new PDO($this->hostname, $this->username, $this->password, $this->options);
    	}
    

    PDO 曾经的连接方式是这样的吗? new PDO 第一个参数不是 dsn??

    4 replies  •  2017-03-14 13:06:15 +08:00
    tms
    tms
    Mar 14, 2017
    1
    你看的这是多老的版本了。
    notgod
    notgod
    Mar 14, 2017
    2
    这个框架不是不开发了吗?
    还有人用?
    duola
    duola
    Mar 14, 2017
    3
    在开发呀,已经更新到 4 了。
    silenceeeee
    silenceeeee
    OP
    Mar 14, 2017
    4
    @tms 是接手别人的代码, 2.x 版本吧 只是觉得这种错误也太低级了,不管什么版本出现这样的错误都说不过去啊。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5057 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 05:59 · PVG 13:59 · LAX 21:59 · JFK 00:59
    ♥ Do have faith in what you're doing.