change the sql query and array