[Tutor] SQLite LIKE question

linuxian iandsd pylinuxian at gmail.com
Fri Apr 11 12:10:01 CEST 2008


I m not sure this is your case but i believe you are missing the
"cur.fetchall()" command which does fetch data from sql db ....
i suggest you put a print statement for every data you use in your program
that way you know whats empty & whats not...
here is example of MySQLdb process:

con=MySQLdb.connect(host='xxxxx', user='xxxxx', passwd='xxxxx',
db='xxxxxxxx' )
cur)

cur=con.cursor()

my_cmd="select %s from xxxx where fieldx= '%s' ; " % (var1, var2)
cur.execute(my_cmd)

#now the cmd you are missing :

data=cur.fetchall()

# & then comes the :

for i in data:
 print i


hope this helps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080411/ad9851d6/attachment.htm 


More information about the Tutor mailing list