This was already answered for you on Quora:
http://www.quora.com/How-can-I-use-crud-select-DB-query-to-extract-values-in-a-DB-table-in-Web2py/answer/Anthony-Bastardi
On Wednesday, December 3, 2014 11:25:31 PM UTC-5, Gideon George wrote:
>
> This is my db
> db = DAL('sqlite://storage.sqlite')
> db.define_table('entry',
> Field('name'),
> Field('location'),
> Field('state_of_origin'),
> Field('local_govt'),
> Field('file', 'upload'),
> Field('posted_on','datetime',readable=False,writable=False)
> )
>
>
> I want to extract only the values from my db table called "entry" using
> crud. I understand i have to do this
> name = crud.select(db.entry, query)
>
> But because i don't know the fomular for extracting the query, I did this
> name = crud.select(db.entry, fields=['name'])
> I got the fields with the values as result.
>
> I just want the values only! Please help me with the formular for getting
> each of the values in my table using query.
>
> Action Controller
>
> def zone():
> db.entry.posted_on.default = request.now
> form=crud.create(db.entry, next=URL('zone'), message=T('Record
> created'))
> name = crud.select(db.entry, fields=['name'])
> location = crud.select(db.entry, fields=['location'])
> state = crud.select(db.entry, fields=['state_of_origin'])
> lga = crud.select(db.entry, fields=['local_govt'])
> image = crud.select(db.entry, fields=['file'])
>
> View
>
> I rep {{=lga}}, {{=state}} State. By {{=name}}<br/>
> lives in {{=location}} on {{=how can I show the time here?}}
>
> ABOVE IS EXACTLY HOW I WANT IT TO APPEAR.
>
--
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.