Hi,
Is there a way to grab the ID (from ID field) while INSERTing a new record?
I am currently doing a separate INSERT then a SELECT query to find the most
recently added record by that user:
select ID from table where user = '$user' order by ID DESC limit 0,1
This does the trick but it may
this is auto_increment, so your trick isn't need.
More in manula of mysql.
regards.
I piasecki - www.b-c.pl
- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 14, 2002 3:23 PM
Subject: [PHP-DB] grabbing id from new record
Hi
.
regards.
I piasecki - www.b-c.pl
- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 14, 2002 3:23 PM
Subject: [PHP-DB] grabbing id from new record
Hi,
Is there a way to grab the ID (from ID field) while INSERTing a new
]
Subject: Re: [PHP-DB] grabbing id from new record
I am sorry, I was not clear in my original request.
The id is auto-incremented. I want to grab the id so that I can use it as
part of a redirect
$q2=select Course_ID from course where HEI_ID = '$inst' order by Course_ID
desc limit 0,1;
$result2
Thanks, just what I was looking for.
George
- Original Message -
From: matt stewart [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 14, 2002 3:26 PM
Subject: RE: [PHP-DB] grabbing id from new record
straight after you do the insert command, use the call:
$ID
PROTECTED]
- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 14, 2002 9:23 AM
Subject: [PHP-DB] grabbing id from new record
Hi,
Is there a way to grab the ID (from ID field) while INSERTing a new
record?
I am currently doing
queries. That was why the WHERE
user='$user' was there.
George
- Original Message -
From: Sam Masiello [EMAIL PROTECTED]
To: George Pitcher [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, January 14, 2002 3:21 PM
Subject: Re: [PHP-DB] grabbing id from new record
That actually isn't