Hotfixed to support mysqli connections in addition to mysql connections.