update to MySQL query functio to allow for for more flexibility in calls to the model