-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.py
37 lines (30 loc) · 981 Bytes
/
database.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import MySQLdb
from Firebase_cred import Firebase_cred
from firebase_admin import db
Firebase_cred.initial()
root = db.reference()
user = root.child("User")
message = root.child("Message")
def insINFO(data):
name = data["Name"]
email = data["Email"]
sex = data["Sex"]
teamName = data["Team Name"]
projectName = data["Project Name"]
projectStatus = data["Project Status"]
phoneNum = data["PhoneNumber"]
try:
user.child(phoneNum).set({
"Name":name,
"Email": email,
"Sex":sex,
"Team Name":teamName,
"Project Name":projectName,
"Project Status":projectStatus,
"Phone Number": phoneNum
})
except Exception as e:
print(e)
if __name__ == "__main__":
data = {'Name': 'GG', 'Email': '[email protected]', 'Sex': 'M', 'Team Name': 'on9', 'Project Name': 'smslack', 'Project Status': 'I', 'PhoneNumber': '+13476680632'}
insINFO(data)