[web2py] Re: Insert method in DAL returns incorrect id

2014-10-05 Thread Niphlod
Simple debug to do what web2py does. print the statement print db.mes._insert(me=metext,locale=localeid) execute it in workbench and then do a select last_insert_id(). what does workbench return ? On Sunday, October 5, 2014 10:42:49 PM UTC+2, Gliese 581 g wrote: > > Please let me kn

[web2py] Re: Insert method in DAL returns incorrect id

2014-10-05 Thread Gliese 581 g
Please let me know what I have to do to get the id of inserted record. -- 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 y

[web2py] Re: Insert method in DAL returns incorrect id

2014-10-05 Thread Gliese 581 g
Yes I have auto increment field and I have done manual insertions and deletions in it. But insert should return latest id irrespective of what I do to the table. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://

[web2py] Re: Insert method in DAL returns incorrect id

2014-10-05 Thread Niphlod
the id returned by DAL is the one mysql sends back as last_insert_id(). Do you have an autoincrement field there ? the only explanation of a wrong id could be that. On Sunday, October 5, 2014 8:56:41 PM UTC+2, Gliese 581 g wrote: > > I have a simple controller method where I insert a record in m