parent
ae88460d3a
commit
d7e4b7b55f
Binary file not shown.
Binary file not shown.
@ -0,0 +1,20 @@
|
|||||||
|
import mysql.connector
|
||||||
|
|
||||||
|
def check(id,psw):
|
||||||
|
db=mysql.connector.connect(
|
||||||
|
host='localhost',
|
||||||
|
user='root',
|
||||||
|
passwd='123456',
|
||||||
|
database='loopy'
|
||||||
|
)
|
||||||
|
|
||||||
|
cursor=db.cursor()
|
||||||
|
sql='select * from user where id = %s and password = %s'
|
||||||
|
cursor.execute(sql,(id,psw))
|
||||||
|
result=cursor.fetchall()
|
||||||
|
for row in result:
|
||||||
|
if id==row[0] and psw==row[1]:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
Loading…
Reference in new issue