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
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
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
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
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
- 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
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
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
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
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
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
>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
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
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 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
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
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
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
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
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
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
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
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
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
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
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,
&
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
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
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
29 matches
Mail list logo