add function query in db.inc