returnbot_bd.SQLRequestToBD1('SELECT group_id FROM user_in_groups WHERE user_id = ?',a_UserID)
cursor=db.cursor()
groups=cursor.execute('SELECT group_id FROM user_in_groups WHERE user_id = ?',(a_UserID)).fetchall()
cursor.close()
db.close()
returngroups
defGetGroupNamesForUser(a_UserID):
defGetGroupNamesForUser(a_UserID):
db=sqlite3.connect(bot_bd.GetBDFileName())
returnbot_bd.SQLRequestToBD1('SELECT groupName FROM user_groups WHERE group_id=(SELECT group_id FROM user_in_groups WHERE user_id = ?)',a_UserID)
cursor=db.cursor()
groups=cursor.execute('SELECT groupName FROM user_groups WHERE group_id=(SELECT group_id FROM user_in_groups WHERE user_id = ?)',(a_UserID)).fetchall()
cursor.close()
db.close()
print(groups)
returngroups
defGetGroupList():
db=sqlite3.connect(bot_bd.GetBDFileName())
cursor=db.cursor()
groups=cursor.execute('SELECT * FROM user_groups').fetchall()
cursor.close()
db.close()
returngroups
defGetGroup(a_GroupID):
db=sqlite3.connect(bot_bd.GetBDFileName())
cursor=db.cursor()
group=cursor.execute('SELECT * FROM user_groups WHERE groupID = ?',([a_GroupID])).fetchall()
cursor.close()
db.close()
returngroup
defAddGroup(a_Name):
db=sqlite3.connect(bot_bd.GetBDFileName())
cursor=db.cursor()
cursor.execute('INSERT INTO user_groups(groupName) VALUES(?)',(a_prjName))
db.commit()
cursor.close()
db.close()
return
defEditGroup(a_GroupID,a_Name):
db=sqlite3.connect(bot_bd.GetBDFileName())
cursor=db.cursor()
cursor.execute('UPDATE user_groups SET groupName = ? WHERE groupID = ?',(a_prjPhoto,a_Name))
db.commit()
cursor.close()
db.close()
return
defDelGroup(a_GroupID):
db=sqlite3.connect(bot_bd.GetBDFileName())
cursor=db.cursor()
cursor.execute('DELETE FROM user_groups WHERE groupID = ?',([a_GroupID]))