[PHP] mysql_insert_id

2002-09-10 Thread Clemson Chan
Hi guys, I never can get mysql_insert_id? Is this broken with PHP4? Please let me know if you can get it to work. or work around. Thanks. --Clemson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mysql_insert_id() vs LAST_INSERT_ID()

2002-02-07 Thread Erik Price
I have two questions: 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 that the PHP function returns the last auto-incremented value from the current connection, and the MySQL

Re: [PHP] mysql_insert_id() vs LAST_INSERT_ID()

2002-02-07 Thread Jason Wong
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread mike cullerton
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread Jimmy
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)?

[PHP] Re: [PHP-DB] Re: [PHP] mysql_insert_id?

2002-01-16 Thread DL Neil
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread DL Neil
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread Jimmy
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread mike cullerton
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread Jimmy
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread DL Neil
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread Jimmy
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

Re: [PHP] mysql_insert_id?

2002-01-16 Thread DL Neil
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,

[PHP] mysql_insert_id?

2002-01-15 Thread Wee Chua
Hi, 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? Thanks, Wee -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] mysql_insert_id?

2002-01-15 Thread DL Neil
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

Re: [PHP] mysql_insert_id?

2002-01-15 Thread DL Neil
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

[PHP] mysql_insert_id + mysql_pconnect = race condition??

2001-11-21 Thread Marc Swanson
In my code I have a few places where I use mysql_pconnect to open a persistant database connection to mysql in order to reduce overhead. I also use mysql_insert_id to fetch insert ids for various insert commands. Since mysql_pconnect uses the SAME database connection between my php

[PHP] mysql_insert_id. need help!

2001-08-29 Thread lizlynch
hi, i have three tables: customer username classification the user will enter my web site enter the relevant customer details (which are transfered to the database) (s)he will then enter their prefered username, password and a password hint (again all sent to the database). once they are

[PHP] mysql_insert_id NEED HELP

2001-08-29 Thread lizlynch
hi, i have three tables: customer username classification the user will enter my web site enter the relevant customer details (which are transfered to the database) (s)he will then enter their prefered username, password and a password hint (again all sent to the database). once they are

Re: [PHP] mysql_insert_id. need help!

2001-08-29 Thread Moax Tech List
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

Re: [PHP] mysql_insert_id()

2001-07-07 Thread Chris Lambert - WhiteCrown Networks
/auto_increment/insert_id()... /* Chris Lambert, CTO - [EMAIL PROTECTED] WhiteCrown Networks - More Than White Hats Web Application Security - www.whitecrown.net */ - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 07, 2001 4:41 PM Subject: [PHP

Re: [PHP] mysql_insert_id()

2001-07-07 Thread Don Read
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

[PHP] mysql_insert_id() CGI

2001-04-03 Thread bill
When I go from using mysql_insert_id() with the module to using it with PHP as CGI it fails because I always provide a link identifier as the argument. When I remove the link identifier it works again. But that seems risky to me. If I have concurrent users couldn't one user finish a query,

RE: [PHP] mysql_insert_id()

2001-01-24 Thread Sam Masiello
t: Wednesday, January 24, 2001 3:50 PM To: Php (E-mail) Subject:[PHP] mysql_insert_id() I'm having intermittent problems with this function. Most of the time, it returns the proper value. However, sometimes it doesn't return anything at all even when the insert query executes without error an

RE: [PHP] mysql_insert_id()

2001-01-24 Thread Boget, Chris
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

RE: [PHP] mysql_insert_id()

2001-01-24 Thread Sam Masiello
- 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&

RE: [PHP] mysql_insert_id()

2001-01-24 Thread Sam Masiello
) 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

RE: [PHP] mysql_insert_id()

2001-01-24 Thread Boget, Chris
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