Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Ismael Alejandro
I think is solved I was working in another function with almost the same
name xD Sorry

2011/7/13 Kenneth Lundström 

>  What happens if you insert a record directly to mysql, can you view it
> from web2py.
>
> In controller return db(db.person.id > 0).select()
>
>
> Kenneth
>
>
> db.define_table('person',
> Field('name','string'))
>
> On Wed, Jul 13, 2011 at 1:11 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Would you show your model?
>>
>>  Richard
>>
>>
>> On Wed, Jul 13, 2011 at 2:08 PM, Ismael Alejandro > > wrote:
>>
>>> Not working :(
>>>
>>>
>>> On Wed, Jul 13, 2011 at 1:02 PM, Richard Vézina <
>>> ml.richard.vez...@gmail.com> wrote:
>>>
 Maybe you forgot : db.commit()

  Richard


 On Wed, Jul 13, 2011 at 1:59 PM, Ismael Alejandro <
 ialejandr...@gmail.com> wrote:

> well, nothing is inserted
>
>
> 2011/7/13 Kenneth Lundström 
>
>>  > hi! I'm very confused, I'm trying to do a simple Insert, like
>> this, db.person.insert(name = 'foo'), but It doesn't work (from a
>> controller).
>>
>>  What happens when you do it in a controller? Do you get an error? If
>> not how do you know it does not work?
>>
>>
>> Kenneth
>>
>>
>>
>> I tried trough appadmin in the query field (same query) and it shows
>> me an error:
>>
>> (1064, u"You have an error in your SQL syntax; check the manual that
>> corresponds to your MySQL server version for the right syntax to use near
>> 'WHERE 6' at line 1")
>>
>> This number is the corresponding ID of the inserted record.
>>
>> but, if I exit the page and then enter again the record is there and
>> fine!!
>>
>> I need it to work from a controller but I can't.
>>
>> I'm using MySQL 5.1.41 and web2py 1.94.5
>>
>>
>>
>

>>>
>>
>
>


Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Richard Vézina
MySQL 5.1.41 is kind of old...
http://dev.mysql.com/doc/refman/5.1/en/news-5-1-41.html

D.1.23. Changes in MySQL 5.1.41 (05 November 2009)

Richard

2011/7/13 Kenneth Lundström 

>  What happens if you insert a record directly to mysql, can you view it
> from web2py.
>
> In controller return db(db.person.id > 0).select()
>
>
> Kenneth
>
>
> db.define_table('person',
> Field('name','string'))
>
> On Wed, Jul 13, 2011 at 1:11 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Would you show your model?
>>
>>  Richard
>>
>>
>> On Wed, Jul 13, 2011 at 2:08 PM, Ismael Alejandro > > wrote:
>>
>>> Not working :(
>>>
>>>
>>> On Wed, Jul 13, 2011 at 1:02 PM, Richard Vézina <
>>> ml.richard.vez...@gmail.com> wrote:
>>>
 Maybe you forgot : db.commit()

  Richard


 On Wed, Jul 13, 2011 at 1:59 PM, Ismael Alejandro <
 ialejandr...@gmail.com> wrote:

> well, nothing is inserted
>
>
> 2011/7/13 Kenneth Lundström 
>
>>  > hi! I'm very confused, I'm trying to do a simple Insert, like
>> this, db.person.insert(name = 'foo'), but It doesn't work (from a
>> controller).
>>
>>  What happens when you do it in a controller? Do you get an error? If
>> not how do you know it does not work?
>>
>>
>> Kenneth
>>
>>
>>
>> I tried trough appadmin in the query field (same query) and it shows
>> me an error:
>>
>> (1064, u"You have an error in your SQL syntax; check the manual that
>> corresponds to your MySQL server version for the right syntax to use near
>> 'WHERE 6' at line 1")
>>
>> This number is the corresponding ID of the inserted record.
>>
>> but, if I exit the page and then enter again the record is there and
>> fine!!
>>
>> I need it to work from a controller but I can't.
>>
>> I'm using MySQL 5.1.41 and web2py 1.94.5
>>
>>
>>
>

>>>
>>
>
>


Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Kenneth Lundström
What happens if you insert a record directly to mysql, can you view it 
from web2py.


In controller return db(db.person.id > 0).select()


Kenneth


db.define_table('person',
Field('name','string'))

On Wed, Jul 13, 2011 at 1:11 PM, Richard Vézina 
mailto:ml.richard.vez...@gmail.com>> wrote:


Would you show your model?

Richard


On Wed, Jul 13, 2011 at 2:08 PM, Ismael Alejandro
mailto:ialejandr...@gmail.com>> wrote:

Not working :(


On Wed, Jul 13, 2011 at 1:02 PM, Richard Vézina
mailto:ml.richard.vez...@gmail.com>> wrote:

Maybe you forgot : db.commit()

Richard


On Wed, Jul 13, 2011 at 1:59 PM, Ismael Alejandro
mailto:ialejandr...@gmail.com>>
wrote:

well, nothing is inserted


2011/7/13 Kenneth Lundström
mailto:kenneth.t.lundst...@gmail.com>>

> hi! I'm very confused, I'm trying to do a simple
Insert, like this, db.person.insert(name = 'foo'),
but It doesn't work (from a controller).

What happens when you do it in a controller? Do
you get an error? If not how do you know it does
not work?


Kenneth




I tried trough appadmin in the query field (same
query) and it shows me an error:

(1064, u"You have an error in your SQL syntax;
check the manual that corresponds to your MySQL
server version for the right syntax to use near
'WHERE 6' at line 1")

This number is the corresponding ID of the
inserted record.

but, if I exit the page and then enter again the
record is there and fine!!

I need it to work from a controller but I can't.

I'm using MySQL 5.1.41 and web2py 1.94.5











Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Richard Vézina
And what about the db=DAL('mysql://username:password@localhost/test')...

Can you see if web2py has create you person table into you mysql database?

You can also try to make a little app that work with sqlite by default and
try your exact same code in in so you will be able to determine if your
problem come from mysql ou connection or web2py or even a bug in web2py...

Richard

It should be like this for mysql

On Wed, Jul 13, 2011 at 2:12 PM, Ismael Alejandro wrote:

> db.define_table('person',
> Field('name','string'))
>
>
> On Wed, Jul 13, 2011 at 1:11 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Would you show your model?
>>
>> Richard
>>
>>
>> On Wed, Jul 13, 2011 at 2:08 PM, Ismael Alejandro > > wrote:
>>
>>> Not working :(
>>>
>>>
>>> On Wed, Jul 13, 2011 at 1:02 PM, Richard Vézina <
>>> ml.richard.vez...@gmail.com> wrote:
>>>
 Maybe you forgot : db.commit()

 Richard


 On Wed, Jul 13, 2011 at 1:59 PM, Ismael Alejandro <
 ialejandr...@gmail.com> wrote:

> well, nothing is inserted
>
>
> 2011/7/13 Kenneth Lundström 
>
>>  > hi! I'm very confused, I'm trying to do a simple Insert, like this,
>> db.person.insert(name = 'foo'), but It doesn't work (from a controller).
>>
>> What happens when you do it in a controller? Do you get an error? If
>> not how do you know it does not work?
>>
>>
>> Kenneth
>>
>>
>>
>> I tried trough appadmin in the query field (same query) and it shows
>> me an error:
>>
>> (1064, u"You have an error in your SQL syntax; check the manual that
>> corresponds to your MySQL server version for the right syntax to use near
>> 'WHERE 6' at line 1")
>>
>> This number is the corresponding ID of the inserted record.
>>
>> but, if I exit the page and then enter again the record is there and
>> fine!!
>>
>> I need it to work from a controller but I can't.
>>
>> I'm using MySQL 5.1.41 and web2py 1.94.5
>>
>>
>>
>

>>>
>>
>


Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Ismael Alejandro
db.define_table('person',
Field('name','string'))

On Wed, Jul 13, 2011 at 1:11 PM, Richard Vézina  wrote:

> Would you show your model?
>
> Richard
>
>
> On Wed, Jul 13, 2011 at 2:08 PM, Ismael Alejandro 
> wrote:
>
>> Not working :(
>>
>>
>> On Wed, Jul 13, 2011 at 1:02 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> Maybe you forgot : db.commit()
>>>
>>> Richard
>>>
>>>
>>> On Wed, Jul 13, 2011 at 1:59 PM, Ismael Alejandro <
>>> ialejandr...@gmail.com> wrote:
>>>
 well, nothing is inserted


 2011/7/13 Kenneth Lundström 

>  > hi! I'm very confused, I'm trying to do a simple Insert, like this,
> db.person.insert(name = 'foo'), but It doesn't work (from a controller).
>
> What happens when you do it in a controller? Do you get an error? If
> not how do you know it does not work?
>
>
> Kenneth
>
>
>
> I tried trough appadmin in the query field (same query) and it shows me
> an error:
>
> (1064, u"You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> 'WHERE 6' at line 1")
>
> This number is the corresponding ID of the inserted record.
>
> but, if I exit the page and then enter again the record is there and
> fine!!
>
> I need it to work from a controller but I can't.
>
> I'm using MySQL 5.1.41 and web2py 1.94.5
>
>
>

>>>
>>
>


Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Richard Vézina
Would you show your model?

Richard

On Wed, Jul 13, 2011 at 2:08 PM, Ismael Alejandro wrote:

> Not working :(
>
>
> On Wed, Jul 13, 2011 at 1:02 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Maybe you forgot : db.commit()
>>
>> Richard
>>
>>
>> On Wed, Jul 13, 2011 at 1:59 PM, Ismael Alejandro > > wrote:
>>
>>> well, nothing is inserted
>>>
>>>
>>> 2011/7/13 Kenneth Lundström 
>>>
  > hi! I'm very confused, I'm trying to do a simple Insert, like this,
 db.person.insert(name = 'foo'), but It doesn't work (from a controller).

 What happens when you do it in a controller? Do you get an error? If not
 how do you know it does not work?


 Kenneth



 I tried trough appadmin in the query field (same query) and it shows me
 an error:

 (1064, u"You have an error in your SQL syntax; check the manual that
 corresponds to your MySQL server version for the right syntax to use near
 'WHERE 6' at line 1")

 This number is the corresponding ID of the inserted record.

 but, if I exit the page and then enter again the record is there and
 fine!!

 I need it to work from a controller but I can't.

 I'm using MySQL 5.1.41 and web2py 1.94.5



>>>
>>
>


Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Ismael Alejandro
Not working :(

On Wed, Jul 13, 2011 at 1:02 PM, Richard Vézina  wrote:

> Maybe you forgot : db.commit()
>
> Richard
>
>
> On Wed, Jul 13, 2011 at 1:59 PM, Ismael Alejandro 
> wrote:
>
>> well, nothing is inserted
>>
>>
>> 2011/7/13 Kenneth Lundström 
>>
>>>  > hi! I'm very confused, I'm trying to do a simple Insert, like this,
>>> db.person.insert(name = 'foo'), but It doesn't work (from a controller).
>>>
>>> What happens when you do it in a controller? Do you get an error? If not
>>> how do you know it does not work?
>>>
>>>
>>> Kenneth
>>>
>>>
>>>
>>> I tried trough appadmin in the query field (same query) and it shows me
>>> an error:
>>>
>>> (1064, u"You have an error in your SQL syntax; check the manual that
>>> corresponds to your MySQL server version for the right syntax to use near
>>> 'WHERE 6' at line 1")
>>>
>>> This number is the corresponding ID of the inserted record.
>>>
>>> but, if I exit the page and then enter again the record is there and
>>> fine!!
>>>
>>> I need it to work from a controller but I can't.
>>>
>>> I'm using MySQL 5.1.41 and web2py 1.94.5
>>>
>>>
>>>
>>
>


Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Richard Vézina
Maybe you forgot : db.commit()

Richard

On Wed, Jul 13, 2011 at 1:59 PM, Ismael Alejandro wrote:

> well, nothing is inserted
>
>
> 2011/7/13 Kenneth Lundström 
>
>>  > hi! I'm very confused, I'm trying to do a simple Insert, like this,
>> db.person.insert(name = 'foo'), but It doesn't work (from a controller).
>>
>> What happens when you do it in a controller? Do you get an error? If not
>> how do you know it does not work?
>>
>>
>> Kenneth
>>
>>
>>
>> I tried trough appadmin in the query field (same query) and it shows me an
>> error:
>>
>> (1064, u"You have an error in your SQL syntax; check the manual that
>> corresponds to your MySQL server version for the right syntax to use near
>> 'WHERE 6' at line 1")
>>
>> This number is the corresponding ID of the inserted record.
>>
>> but, if I exit the page and then enter again the record is there and
>> fine!!
>>
>> I need it to work from a controller but I can't.
>>
>> I'm using MySQL 5.1.41 and web2py 1.94.5
>>
>>
>>
>


Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Ismael Alejandro
well, nothing is inserted

2011/7/13 Kenneth Lundström 

>  > hi! I'm very confused, I'm trying to do a simple Insert, like this,
> db.person.insert(name = 'foo'), but It doesn't work (from a controller).
>
> What happens when you do it in a controller? Do you get an error? If not
> how do you know it does not work?
>
>
> Kenneth
>
>
>
> I tried trough appadmin in the query field (same query) and it shows me an
> error:
>
> (1064, u"You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> 'WHERE 6' at line 1")
>
> This number is the corresponding ID of the inserted record.
>
> but, if I exit the page and then enter again the record is there and fine!!
>
> I need it to work from a controller but I can't.
>
> I'm using MySQL 5.1.41 and web2py 1.94.5
>
>
>


Re: [web2py] INSERT Error? or Bug?

2011-07-13 Thread Kenneth Lundström
> hi! I'm very confused, I'm trying to do a simple Insert, like this, 
db.person.insert(name = 'foo'), but It doesn't work (from a controller).


What happens when you do it in a controller? Do you get an error? If not 
how do you know it does not work?



Kenneth



I tried trough appadmin in the query field (same query) and it shows 
me an error:


(1064, u"You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near 'WHERE 6' at line 1")


This number is the corresponding ID of the inserted record.

but, if I exit the page and then enter again the record is there and 
fine!!


I need it to work from a controller but I can't.

I'm using MySQL 5.1.41 and web2py 1.94.5