forked from EldhoseKuriakose/Melanoma-Skin-Cancer-Detector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbase1.py~
39 lines (35 loc) · 948 Bytes
/
dbase1.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
38
39
import sqlite3
def regis(nam,age,phn,mail,unam,pas):
db=sqlite3.connect("melanoma.db")
c=db.cursor()
print nam+" "+unam+" "+pas+" "+age+" "+phn+" "+mail
query="INSERT INTO regis (name,age,phone,email,username,password) VALUES ('%s','%s','%s','%s','%s','%s')"%(nam,age,phn,mail,unam,pas)
try:
c.execute(query)
db.commit()
val=c.fetchone
return val
except Exception,e:
print "In Exception",e
db.rollback()
db.close()
return 0
def logcheck(unam,pas):
db=sqlite3.connect("melanoma.db")
c=db.cursor()
flag=0
idd=0
try:
query="SELECT * FROM regis"
c.execute(query)
result=c.fetchall()
for rows in result:
una=rows[5]
pa=rows[6]
if una == unam and pa == pas :
flag=1
idd=rows[0]
return flag
except:
print "Unable to fetch!!!"
db.close()