def insert_mid(mid_list): """ Save user's mid to userinfo table :return: """ user_sql = "insert into userinfo(mid) values({});" MySQLDB.insert_many(user_sql, mid_list)
def aid_insert(aids, base_aid): """ Insert video's aid to aid table and mark the aid been used :return: """ aid_sql = "INSERT INTO aid(aid) VALUES ({});" MySQLDB.insert_many(aid_sql, aids) mark_sql = "UPDATE aid SET mark=1 where aid={};".format(base_aid) MySQLDB.update(mark_sql)