Re: How to call mysql_insert_id

2005-04-11 Thread Jan Pieter Kunst
On Apr 12, 2005 1:37 AM, Siegfried Heintze <[EMAIL PROTECTED]> wrote: > Thanks, JP. > And will this work for multi-threaded, multi-user applications? > Siegfried Yes: "The last ID that was generated is maintained in the server on a per-connection basis. This means the value the function returns t

RE: How to call mysql_insert_id

2005-04-11 Thread Siegfried Heintze
Thanks, JP. And will this work for multi-threaded, multi-user applications? Siegfried -Original Message- From: Jan Pieter Kunst [mailto:[EMAIL PROTECTED] Sent: Monday, April 11, 2005 3:05 PM To: mysql@lists.mysql.com Subject: Re: How to call mysql_insert_id On Apr 11, 2005 10:50 PM

Re: How to call mysql_insert_id

2005-04-11 Thread Jan Pieter Kunst
On Apr 11, 2005 10:50 PM, Siegfried Heintze <[EMAIL PROTECTED]> wrote: > * In MySQL - mysql_insert_id() > > How do I call this function? I was hoping I could use SQL such as "SELECT > mysql_insert_id() FROM XYZ" but I discovered that does not work. I'm usin

How to call mysql_insert_id

2005-04-11 Thread Siegfried Heintze
f the index on the newly created >>row so I can use that the value of a foreign key in another relation? > That's database specific, and you haven't specified a database. * In MySQL - mysql_insert_id() How do I call this function? I was hoping I could use SQL

Re: mysql_insert_id() for UPDATE?

2004-10-13 Thread Michael Ragsdale
At 11:36 AM 10/13/2004, Paul DuBois wrote: At 11:10 -0400 10/13/04, Michael Ragsdale wrote: I've been using mysql_insert_id() with great success, but now I've got a problem. I'm using UPDATE to, well, update a record in a database and according to the docs... mysql_insert_id() i

Re: mysql_insert_id() for UPDATE?

2004-10-13 Thread Rhino
- Original Message - From: "Michael Ragsdale" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 13, 2004 11:10 AM Subject: mysql_insert_id() for UPDATE? > I've been using mysql_insert_id() with great success, but now I've got a &g

Re: mysql_insert_id() for UPDATE?

2004-10-13 Thread SGreen
to update and actually perform the updates. Shawn Green Database Administrator Unimin Corporation - Spruce Pine Michael Ragsdale <[EMAIL PROTECTED]> wrote on 10/13/2004 11:10:12 AM: > I've been using mysql_insert_id() with great success, but now I've got a > problem. I&#

Re: mysql_insert_id() for UPDATE?

2004-10-13 Thread Paul DuBois
At 11:10 -0400 10/13/04, Michael Ragsdale wrote: I've been using mysql_insert_id() with great success, but now I've got a problem. I'm using UPDATE to, well, update a record in a database and according to the docs... mysql_insert_id() is updated after INSERT and UPDATE s

mysql_insert_id() for UPDATE?

2004-10-13 Thread Michael Ragsdale
I've been using mysql_insert_id() with great success, but now I've got a problem. I'm using UPDATE to, well, update a record in a database and according to the docs... mysql_insert_id() is updated after INSERT and UPDATE statements that generate an AUTO_INCREMENT value or th

clarifications on mysql_insert_id

2003-10-16 Thread bluejack
There was a question last week about the behavior of this function, which is inconsistently (and inaccurately) documented in the manual. A little black box testing shows the following: 1) mysql_insert_id successfully retrieves the last auto_inserted id used by a connection. 2) multiple

Re: How to use LAST_INSERT_ID() or mysql_insert_id() ?

2002-07-28 Thread Georg Richter
created during the > insert process. Fortunately its not possible to combine multiple commands in a single query (that would be a security hole). You have to send two queries instead, or you can use the php function mysql_insert_id after executing the 1st query. > I'm using, according to

Re: How to use LAST_INSERT_ID() or mysql_insert_id() ?

2002-07-28 Thread Gordon Burditt
>I know this is an old query, but still, problems . . . > >I've tried these both, but something is amiss - probably my interpretation. > >Every time I try to use LAST_INSERT_ID() I get a complaint that the >query has a problem. > >E.G., $qry=$qry.";select LAST_INSERT_ID();" will blow up on me ever

How to use LAST_INSERT_ID() or mysql_insert_id() ?

2002-07-28 Thread databarn
Folk, I know this is an old query, but still, problems . . . I've tried these both, but something is amiss - probably my interpretation. Every time I try to use LAST_INSERT_ID() I get a complaint that the query has a problem. E.G., $qry=$qry.";select LAST_INSERT_ID();" will blow up on me ever

Re: mysql_insert_id returns 0 for multiple-row inserts

2002-03-04 Thread Sinisa Milivojevic
Michael Villalba writes: > mysql_insert_id returns the correct value to my application when I insert a > single > row using the INSERT...VALUES syntax. However, when I insert multiple rows, > it always returns 0. This is inconsistent with the behavior of > LAST_INSERT_ID, > wh

mysql_insert_id returns 0 for multiple-row inserts

2002-03-02 Thread Michael Villalba
mysql_insert_id returns the correct value to my application when I insert a single row using the INSERT...VALUES syntax. However, when I insert multiple rows, it always returns 0. This is inconsistent with the behavior of LAST_INSERT_ID, which returns the id of the first row. Has anyone else

Re: mysql_insert_id error

2002-02-12 Thread DL Neil
Hi Andrea, > I am really new at PHP & MySQL, so please bear with me. welcome to our happy band... > I am using the mysql_insert_id function but continually receive an error, > and hoping someone can point me in the right direction to resolve this. > > My error: > Warning

Re: Resolved: mysql_insert_id error

2002-02-12 Thread Paul DuBois
At 14:07 -0700 2/6/02, Nathan Bank wrote: >Though this is a PHP issue, for those that use PHP here's what was >wrong: mysql_insert_id() requires >your connection link identifier, which is what is returned from >mysql_connect and mysql_pconnect. >This is contrary to alm

Re: Resolved: mysql_insert_id error

2002-02-06 Thread Paul DuBois
At 14:07 -0700 2/6/02, Nathan Bank wrote: >Though this is a PHP issue, for those that use PHP here's what was >wrong: mysql_insert_id() requires >your connection link identifier, which is what is returned from >mysql_connect and mysql_pconnect. >This is contrary to alm

Resolved: mysql_insert_id error

2002-02-06 Thread Nathan Bank
Though this is a PHP issue, for those that use PHP here's what was wrong: mysql_insert_id() requires your connection link identifier, which is what is returned from mysql_connect and mysql_pconnect. This is contrary to almost all other mysql_ functions, which want the result resource ret

Re: mysql_insert_id error

2002-02-06 Thread DL Neil
Hi Andrea, > I am really new at PHP & MySQL, so please bear with me. welcome to our happy band... > I am using the mysql_insert_id function but continually receive an error, > and hoping someone can point me in the right direction to resolve this. > > My error: > Warning

mysql_insert_id error

2002-02-06 Thread Andrea Caldwell
Hi there, I am really new at PHP & MySQL, so please bear with me. I am using the mysql_insert_id function but continually receive an error, and hoping someone can point me in the right direction to resolve this. My error: Warning: Supplied argument is not a valid MySQL-Link resource on lin

mysql_insert_id and transactions

2001-11-30 Thread Jason Hall
allrighty, for you perl/mysql folks here is the trouble I'm having. I'm tyring to do a transaction in mysql/innodb in perl with the following basic flow eval{ Insert my first record get the insert_id (using $sth->{mysql_insert_id}) now

Re: mysql_insert_id

2001-10-01 Thread Benjamin Pflugmann
Hi. You know, mysql_insert_id returns a 64 bit integer (see http://www.mysql.com/doc/m/y/mysql_insert_id.html)? Though, ignoring this, you should normally get a steady 0 returned. Another possible cause of failure could be that you did not recompile your application and therefore have a version

mysql_insert_id

2001-10-01 Thread Matthew Fincham
Hello Firstly, this is my first query, so I can only hope I have sent it to the correct list! I am using the C API for MySQL, and using the mysql_insert_id() function to get the last id assigned in an AUTO INCREMENT column. Orignially I was using 3.22.32 and everything worked fine. Upon

Re: How To call mysql_insert_id

2001-09-30 Thread Paul DuBois
At 6:45 PM -0500 9/30/01, Reuben D Budiardja wrote: >Hi, >I am a newbie in MySQL. I use an auto_increment to insert to one of the >column. How do I get the value inserted? > >The documentation seems to suggest using mysql_insert_id() function. But when >I tried to cal

RE: How To call mysql_insert_id

2001-09-30 Thread Daniel Ouellet
You were close to it. But he way to get the last inserted item on AUTO_INCREMENT field is for example: id = mysql_insert_id(&mysql); printf("The last insert is: %d\n", id); And mysql is what was return to you when you open your connection to the database. Daniel > Hi, &

How To call mysql_insert_id

2001-09-30 Thread Reuben D Budiardja
Hi, I am a newbie in MySQL. I use an auto_increment to insert to one of the column. How do I get the value inserted? The documentation seems to suggest using mysql_insert_id() function. But when I tried to call it using Select mysql_insert_id() or Select mysql_insert_id() from TABLE_NAME

Re: mysql_insert_id()- MySQL C API

2001-07-23 Thread Benjamin Pflugmann
Hi. On Mon, Jul 23, 2001 at 04:32:54PM +0400, [EMAIL PROTECTED] wrote: > Problem: INSERT fields AUTO_INCREMENT passes correctly, and call > after that mysql_insert_id () all the same returns 0. Linux 2.2.14 > operating system. Mysql version - 2.23.38 Hm. You know that the return va

mysql_insert_id()- MySQL C API

2001-07-23 Thread Ушаровский Олег
Problem: INSERT fields AUTO_INCREMENT passes correctly, and call after that mysql_insert_id () all the same returns 0. Linux 2.2.14 operating system. Mysql version - 2.23.38