Hi 
could you explain me why it does not work :
my file db.py (a part of file)

loginsession = auth.user.username
dbRH = DAL('mysql://xxx:xxx@localhost/RH', pool_size=0)
dbRH.define_table('test',
    SQLField('login', type = 'string' , length = 20 ),
    SQLField('nom', type = 'string' , length = 20 ),
    SQLField('prenom', type = 'string' , length = 20 ),
    SQLField('groupe', type = 'string' , length = 15 ),
    SQLField('mail', type = 'string' , length = 50 ),
    migrate = False)
query='SELECT * from test WHERE login=loginsession'
firstname =dbRH.executesql(query,as_dict=True)

If i replace the var loginsession by "toto", it works and the var 
loginsession has a value ...

Another question about DAL if i follow the doc :
#q=dbRH.test.login==loginsession
#s=db(q)
#rows=s.select()
#for row in rows:
#    prenom = row.prenom

does not run too ...


Thank you in advance 
Regards,



-- 
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.

Reply via email to