I'm getting "None" printed in the webpage. I'm trying to print all
first_name in the users table database. I'm trying to follow the select
section
in
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Query--Set--Rows
I'm using MySQL for database and have few test records inserted in the
users table. Please let me know what am I missing in the controller. I
appreciate your help. Thanks
*My Model: *
db.define_table('users',
Field('first_name', 'text'),
Field('last_name', 'text'))
*My Controller:*
def printall():
for row in db(db.users.id > 0).select(db.users.ALL):
print row.first_name
or
def printall():
for row in db().select(db.users.ALL):
print row.first_name
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.