Changed function of database to simplify query execution rather than re-writing all the existing mysqli functions.