Better way to handle mySql request