I have a foreach loop that forks within it. After the process forks, it accesses the database. I get an error:
SQLSTATE[HY000]: General error: 2006 MySQL ser
You need to close the MySQL connection on your parent process and then make a new connection for each child.