RE: [PHP-WIN] ODBC to Access with Autonumber Field
| From: | Pablo Marugán | Date: | Wed, 21 Nov 2001 15:55:21 +0000 |
| Subject: | RE: [PHP-WIN] ODBC to Access with Autonumber Field | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-10568@lists.php.net to get a copy of this message | ||
You should try inserting the record with the next syntax:
INSERT INTO table (fieldname1,fieldname2) VALUES
(fieldname1value,fieldname2value)
This way you can ignore the Autonumber field...
For the second question, an option could be having a timestamp field on the
table you want and then, making a select ordered by the timestamp field in
descending order. This should make it possible to retrieve the last inserted
record's id.
> -----Mensaje original-----
> De: Greg Sohl [mailto:gsohl@freedomgroup.com.noreply]
> Enviado el: miércoles, 21 de noviembre de 2001 15:18
> Para: php-windows@lists.php.net
> Asunto: [PHP-WIN] ODBC to Access with Autonumber Field
>
>
> Hi,
>
> Does anyone have an example of Inserting a record to a table in an Access
> database where one of the fields is an Autonumber field, and most
> importantly, retrieving the value of the newly inserted Autonumber field?
> I'm looking for the equivilant of mysql_insert_id() for ODBC. Thanks.
>
> Greg Sohl
> Cedar Rapids, IA
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>