My Config files are below
db.py
# -*- coding: utf-8 -*-
if not request.env.web2py_runtime_gae:
## if NOT running on Google App Engine use SQLite or other DB
##db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
db = DAL('mysql://xxxxxxx',pool_size=1,check_reserved=['all'])
else:
## connect to Google BigTable (optional 'google:datastore://namespace')
db = DAL('google:datastore')
## store sessions and tickets there
session.connect(request, response, db=db)
response.generic_patterns = ['*'] if request.is_local else []
from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db)
crud, service, plugins = Crud(db), Service(), PluginManager()
## create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=False)
db.define_table('user_details',
Field('user_id', 'text'),
Field('first_name', 'text'),
Field('last_name', 'text'),
Field('city', 'text'),
Field('user_st', 'text'),migrate=True)
user_details created already in MySQL. I want to display the information of all the records from the table.
My home page code is
{{ rows = db(db.user_details).select() }}
{{if len(rows):}}
<ul>
{{ for r in rows: }}
<li>
{{=r.name}}
</li>
{{pass}}
</ul>
{{pass}}
I am not able to find out the issue. Any help appreciated. Thanks.
hey. I have created a mysql database in my web2py app.
how can i store all the sqlite database in a variable????? smbdy help me with full code pls