title: Trying to make a login script with web.py
body: <p>I'm trying to make a login script with web.py but i cant seem to figure it out!</p>
  
  <p>I'm using MySQLdb for the database engine.</p>
  
  <p>Here are the two approaches I have but neither seem to be working. if someone can help me it would be very much appreciated.</p>
  
  <p>Method 1</p>
  
  <pre><code>class login():
      def GET(self):
          return render.login()
      def POST(self):
          i = web.input()
          d = i.username
          email = db.select('users', where='email')
  
          if d == email:
              return"Success!"
          else:
              return"Nahh"
  </code></pre>
  
  <p>Method 2</p>
  
  <pre><code>class login():
      def GET(self):
          return render.login()
      def POST(self):
          i = web.input()
          u = i.username
          p = i.password
          d = db.query("SELECT * FROM users WHERE username=i.username AND password=i.password")
          g = db.num_rows(d)
          if g == 1:
              return "Success!"
          if g != 1:
              return "Fail!"
  </code></pre>
  
  <p>What am I doing wrong? I'm still new to Web.py and I know the first example doesn't really make sense... but its just a theory I had if that makes sense.</p>