mysql: troubles with insert

Henk van der Velden henk at iglow-media.nl
Fri Jul 20 04:18:02 EDT 2007


Thanks Mark,

it is not an auto_increment field.

I think something is wrong in the way Rev creates a query out of my  
array.
If I force Rev to put the right value in the query by doing this:
     put "INSERT INTO g2_Entity() VALUES('"&vars[1]&"',: 
2,:3,:4,:2,:3,:5,:4)" into tsql
the record is inserted with the correct id.
But the standard way:
     put "INSERT INTO g2_Entity() VALUES(:1,:2,:3,:4,:2,:3,:5,:4)"  
into tsql
inserts it with the wrong id.

I have double checked the values of my array vars[] - it is OK.

I was wondering if this might have something to do with the way Rev  
handles arrays. Rev 'does' only associative arrays, not numeric  
arrays, isn' t it? I was a bit surprised to find out that I had to  
use numeric arrays in order to build queries.

Just a thought..

Henk

> Henk-
>
> Probably a silly question, but I don't suppose id is an auto_increment
> field?
> If so, you want to specify null for the id and you won't be able to  
> override
> it.
>
> -- 
>  Mark Wieder
>  mwieder at ahsoftware.net



More information about the use-livecode mailing list