replaced mysqli with pdo on the frontend