> ------=_NextPart_000_0091_01BFA625.F050EF60
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> hi,
>
> I have a form
> the form action is sell.php3
> for an autoincrement field i use=20
> $query =3D"INSERT INTO table1... ";
> $query .=3D"VALUES ('$field1','$field2',LAST_INSERT_ID())";
>
> I am trying to echo the calue of the auto inc field by using the =
> following code I found in a book
>
> echo "the last inserted id #: ".mysql_insert_id(). "\n";
>
> The value I keep getting is 0 - would anyone know why?
Add some error-checking code, as described in the FAQ (look for " or
die()") in some of the solutions there.
--
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-uns...@lists.php.net
To subscribe to the digest, e-mail: php3-diges...@lists.php.net
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-lis...@lists.php.net