Database management in single PHP file