CodeIgniter-Chinese / CodeIgniter

开源 PHP 框架 CodeIgniter 中国社区分支
http://codeigniter.org.cn/
MIT License
65 stars 26 forks source link

DB class trouble with pcntl #31

Closed beg163 closed 9 years ago

beg163 commented 9 years ago

hello, when I use DB class after pcntl_fork, there will be a Error: "2006 mysql server has gone away". Only the first sql can be executed successly. I think CI will close all mysql connections after execute any one sql. I tried "$this->db->db_connect();$this->db->query();$this->db->close();" and "$this->db->reconnect()", but both didn't work. At last ,I have to new Mysqli to finish it . So ,how to write this code like CI's case? thank you.