Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python SQLite Return Value

Tags:

python

sqlite

I am trying to return a numeric value from this statement:

c = db.execute("""SELECT *, rowid FROM members WHERE barcode = '%s' AND debit > 0 LIMIT 50""" % (s,))

But I get this as the returned value:

sqlite3.Cursor object at 0xb6cb2720

What should I do with this cursor object to get the results?

like image 450
Shane Morris Avatar asked Aug 03 '26 03:08

Shane Morris


1 Answers

Try this:

for row in c:
    print row['rowid']
like image 104
chishaku Avatar answered Aug 05 '26 16:08

chishaku



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!