title: Can't get the last row id from SQLITE3 database
body: <p>I have a script that asks for input, and that input is then inserted into a table.
  The next time the script is run, I'd like for it to tell the user what id the last input has.</p>
  
  <p>The table looks like: id INTEGER PRIMARY KEY AUTOINCREMENT, userid TEXT, domain TEXT, password TEXT, webserver TEXT, sqlserver TEXT</p>
  
  <p>I was told I could use SELECT seq from SQLITE_SEQUENCE WHERE name='table_name' but it yields the following text:  instead of the id from the last row.</p>
  
  <p>Please note that I'm an extremely new Python / SQLite3 coder!</p>
  
  <p>For your reference, the code sofar looks like this:</p>
  
  <pre><code>#!/usr/bin/python
  import os, sys, sqlite3
  ######## CHECK SYSTEM COMPATIBILITY ########
  if os.name =='posix':
      os.system("clear")#CLEAR SCREEN#
      pass
  else:
      sys.exit("Operating System is not supported")
  ######## END CHECK SYSTEM COMPATIBILITY ########
  ######## CHECK IF SCRIPT IS RUN AS ROOT ########
  #if os.geteuid() != 0:
  #       sys.exit("Script must be run as root")
  #else:
  #       pass
  ####### END CHECK IF SCRIPT IS RUN AS ROOT ########
  ####### CREATE DATABASE AND CHECK IF TABLE EXISTS ##########
  conn = sqlite3.connect("dat.db")
  c = conn.cursor()
  c.execute ('''CREATE TABLE IF NOT EXISTS kunder
              (id INTEGER PRIMARY KEY AUTOINCREMENT, userid TEXT, domain TEXT, password      TEXT, webserver TEXT, sqlserver TEXT)''')
  conn.commit()
  print c.execute ("SELECT seq from SQLITE_SEQUENCE WHERE name='kunder'")
  conn.close()
  ######## DONE CREATE DATABASE AND CHECK IF TABLE EXISTS #########
  ###### ASK FOR INPUT ##########
  ########### HERE NEEDS TO BE A CHECK TO DETERMINE THE LATEST USERID - ALSO NEEDS TO BE    FOR WEBSERVER AND PASSWORD #################
  userid = raw_input("Enter userid: ")
  ########### HERE NEEDS TO BE A CHECK TO SEE IF USERID EXISTS!!!!!#####################
  domain = raw_input("Enter domain: ")
  password = raw_input("Enter password: ")
  ########### NEEDS TO BE A WAY TO AUTOGENERATE A PASSWORD!!! ####################
  webserver = raw_input("Enter webserver: ")
  sqlserver = raw_input("Enter sqlserver: ")
  ###### FINISHED ASK FOR INPUT #######
  ######## DATABASE ###########
  conn = sqlite3.connect("dat.db")
  c = conn.cursor()
  c.execute ("INSERT INTO kunder (userid, domain, password, webserver, sqlserver) VALUES    (?,?,?,?,?)", (userid, domain, password, webserver, sqlserver))
  conn.commit()
  conn.close()
  ####### DONE WITH DATABASE ##########
  </code></pre>