del sessionid from database

query = """SELECT user_id, COUNT(text_message) FROM user_message
+                WHERE recipient_id=%s AND flag=False  GROUP BY user_id"""
+    cursor.execute(query, (recipient_id))