On Sun, Apr 29, 2001 at 03:38:07PM +0200, [EMAIL PROTECTED] wrote:
> My insert query look like your
> 'INSERT INTO ordinit(ID_ordine, Cod_Cliente) VALUES (NULL, 10);';
> after the query I look into the table 'ordinit' and always looks fine: the value of 
> ID_ordine is really incremented.
> But the following 'select LAST_INSERT_ID()' return zero :-((

Weird. I've used them often (on ISAM tables) and it works just fine.

Do you use the same connection for the 'LAST_INSERT_ID' query as for
the INSERT query? The LAST_INSERT_ID is kept per connection and until
another INSERT is done.


Regards,

Fred.


> >What does your INSERT query look like? It should specify NULL
> >for ID_ordine, e.g.:
> 
> >INSERT INTO ordinit(ID_ordine, Cod_Cliente) VALUES (NULL, 10);
> 
> >Any other value for ID_ordine will not assign an auto_increment
> >value.
> 
> 

-- 
Fred van Engen                              XO Communications B.V.
email: [EMAIL PROTECTED]             Televisieweg 2
tel: +31 36 5462400                         1322 AC  Almere
fax: +31 36 5462424                         The Netherlands

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to