mysql_insert_id
bastien
From: "Aaron Todd" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-DB] getting data back when inserting
Date: Wed, 1 Dec 2004 11:01:19 -0500
I was wondering if somone might be able to suggest a command to me...I am
inserting data into a MySQL database that has an aut
Thanks a bunch...thats exactly what I was looking for.
Aaron
"Stefan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
You should easily use
mysql_insert_id();
otherwise you could use something like:
SELECT max(id) FROM ...
But I think the first command is what you're looking for
You should easily use
mysql_insert_id();
otherwise you could use something like:
SELECT max(id) FROM ...
But I think the first command is what you're looking for.
Stefan
> -Ursprüngliche Nachricht-
> Von: Aaron Todd [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 1. Dezember 2004 17
I know this is only semi-helpful, but maybe it'll give you a kick in the
right direction.
In Microsoft SQL-Server you'd use @@IDENTITY to get the ID of the last
row you inserted. There's bound to be something similar in other DB
systems. "identity" is what SQL Server calls auto-number type field