changed db layer to mysqli