Jump to content

database statement problem in python

- - - - -

  • Please log in to reply
No replies to this topic

#1
mutago

mutago

    Programmer

  • Members
  • PipPipPipPip
  • 102 posts
I need to print error text message if id value in the database is greater than 1
and then log user in if their username and password is correct
and finally display error message if username and password is wrong. I tried using the code below
but it return error page, any help



#check if the value id in the database is greater than 1

if row['id'] > 1:

print "error your id is greater than 1"



#check if username and password is correct to log user in

elif username == row['username'] and password == row['password']: 

print "user successfully loged in"


else:

print "wrong username and password"







1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users