On Thursday 07 February 2002 23:08, Erik Price wrote:
I have two questions:
I think the php-db list is more appropriate for these.
1. Can anyone tell me whether the following statement is true or false?
The PHP function mysql_insert_id() differs from the MySQL function
LAST_INSERT_ID() in
on 1/16/02 7:42 AM, Martin Wickman at [EMAIL PROTECTED] wrote:
Dl Neil wrote:
2 because the (function argument) controlling feature is the connection, it
is not possible for another
concurrent user to 'steal' your ID or influence the ID returned to you - it's
all yours!
Ok, assume you
Hi Martin,
2 because the (function argument) controlling feature is the
connection, it is not possible for another concurrent user to
'steal' your ID or influence the ID returned to you - it's all
Ok, assume you are correct, but what if you are using persistent
connections (ie pconnet)?
Hi Martin,
2 because the (function argument) controlling feature is the connection, it is not
possible for another
concurrent user to 'steal' your ID or influence the ID returned to you - it's all
yours!
Ok, assume you are correct, but what if you are using persistent
connections (ie
Hi Jimmy,
2 because the (function argument) controlling feature is the
connection, it is not possible for another concurrent user to
'steal' your ID or influence the ID returned to you - it's all
Ok, assume you are correct, but what if you are using persistent
connections (ie
Hi DL,
the only problem i can think of might occur with pconnect is,
last_insert_id() will return you the last inserted ID from
previous 'session', not current 'session'.
to prevent this, you should call last_insert_id() only when
your INSERT query executed succesfully.
=Of course a
on 1/16/02 10:47 AM, Jimmy at [EMAIL PROTECTED] wrote:
Hi DL,
the only problem i can think of might occur with pconnect is,
last_insert_id() will return you the last inserted ID from
previous 'session', not current 'session'.
to prevent this, you should call last_insert_id() only when
Hi mike,
last_insert_id() will return you the last inserted ID from
previous 'session', not current 'session'.
to prevent this, you should call last_insert_id() only when
your INSERT query executed succesfully.
Most probably the returned value would be wrong, because it will
return the
Hi Jimmy,
the only problem i can think of might occur with pconnect is,
last_insert_id() will return you the last inserted ID from
previous 'session', not current 'session'.
to prevent this, you should call last_insert_id() only when
your INSERT query executed succesfully.
=Of course
Hi DL,
=session is not the correct word/its use is potentially confusing
(perhaps that's why it's in quotes?) - persistence refers to the
continuing connection between PHP and MySQL.
yup, you're right.
session is not the correct word, but i can't find the
correct/easy word to subtitute
Jimmy,
However it is also possible that in order to save time the LAST_ID
information is built into the resultset coming back from the INSERT -
thus when mysql_insert_id() is called PHP would not need to go back
to MySQL/last_insert_id().
yes, what you said could be true also.
Well,
Hi Wee,
Is it possible that I would get the wrong ID (Not the ID I just inserted in
Auto_Increment field) by using mysql_insert_id function if someone is also
inserting record at the same time? How does mysql_insert_id work accurately?
=A couple of things here:
1 if the field is defined as
Hi Wee,
Is it possible that I would get the wrong ID (Not the ID I just inserted in
Auto_Increment field) by using mysql_insert_id function if someone is also
inserting record at the same time? How does mysql_insert_id work accurately?
=A couple of things here:
1 if the field is defined as
post your code.
- Original Message -
From: lizlynch [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 29, 2001 4:32 AM
Subject: [PHP] mysql_insert_id. need help!
hi,
i have three tables:
customer
username
classification
the user will enter my web site enter the relevant
I've used integer on many occasions with auto_increment, and have had no
problems. mysql_insert_id() returns the unique identifyer of the last record
inserted with mysql_query(). I'm not sure what MySQL function you're
referencing as an alternative, but you should be fine with an
On 07-Jul-01 Chris Lambert - WhiteCrown Networks wrote:
I've used integer on many occasions with auto_increment, and have had no
problems. mysql_insert_id() returns the unique identifyer of the last record
inserted with mysql_query(). I'm not sure what MySQL function you're
referencing as an
When you are using mysql_insert_id, you don't want to pass it the result of
your previous SQL statement as in:
$result = mysql"mydb", "My SQL statement", $my_connect) ;
$last_id = mysql_insert_id($result)
Rather, you want to pass it the link identifier from your mysql_connect
like:
$result =
When you are using mysql_insert_id, you don't want to pass it
the result of your previous SQL statement as in:
$result = mysql"mydb", "My SQL statement", $my_connect) ;
$last_id = mysql_insert_id($result)
This is what it sounds like it's looking for in the documentation. It
could be just
-
From: Boget, Chris [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 4:20 PM
To: 'Sam Masiello'; Php (E-mail)
Subject: RE: [PHP] mysql_insert_id()
When you are using mysql_insert_id, you don't want to pass it
the result of your previous SQL statement as in:
$result = mysql"mydb&
)
Subject: RE: [PHP] mysql_insert_id()
You probably stated this in your previous post, but what is
the result from your call to mysql() ? Is this call failing so
that when you get to mysql_insert_id(), the id doesn't exist?
I did. It's returning a numerical one (1).
What I'm doing now
Instead of checking if(!$id), perhaps you would be better off to check the
result of your query (which in this example was successful, since you got
a return from mysql() ).
I am. I just didn't include it in my previous message as it as I was trying
to
keep extraneous code down to a
21 matches
Mail list logo