Connecting Tech Pros Worldwide Forums | Help | Site Map

retrieveing data in pysqlite by user input

Newbie
 
Join Date: Oct 2008
Posts: 14
#1: Feb 14 '09
hello everyone

How can i be able to prompt users to query their search about photos Date in which date formate is "2008:12:10". by the way the following codes are hardcoded.
Expand|Select|Wrap|Line Numbers
  1. import os
  2. import sqlite3
  3. from pysqlite2 import dbapi2 as sqlite3
  4. #import Database.py
  5.  
  6. #Retrieving Data from DB
  7.  
  8. connection = sqlite3.connect('Photos.db')
  9. memoryConnection = sqlite3.connect(':memory:')
  10. cursor = connection.cursor()
  11. cursor.execute('SELECT * FROM photos where Date = "2008:10:12 15:19:16 "')
  12. print cursor.fetchall()

Reply