I GOT IT! WooHoo!
Thanks to a co-worker, this problem has been solved! I was using
scope_identity incorrectly.
This is how you should use it:
INSERT INTO Table1 (
Column1,
Column2)
VALUES (
Value1,
Value2)
INSERT INTO Table2 (
Column1,
Column2)
VALUES (
scope_identity(),
> Okay, I found the correct function and below is what I have:
>
> - Show quoted text -
> $insert1 = "INSERT INTO table1 (
)
> VALUES (
)
>
> SELECT scope_identity()
>
> INSERT INTO table2 (
> credit_card_id,
> case_number,
> comments)
> VALUES (
>
Okay, I found the correct function and below is what I have:
- Show quoted text -
$insert1 = "INSERT INTO table1 (
debit_card,
card_type,
card_number,
exp_date,
payment_amount,
cvv_number,
first_name,
middle_name,
last_name,
address_1,
addres
Brad Fuller wrote:
>From looking on the web (MSDN) I found the @@identity and the explanation
of
what it is, but MS's "example" is horrible and does not show a good
context
for using this function. Could you elaborate more on its use?
$q = mssql_query("INSERT INTO TableName(...) VALUES(...) SE
> >From looking on the web (MSDN) I found the @@identity and the explanation
> of
> what it is, but MS's "example" is horrible and does not show a good
> context
> for using this function. Could you elaborate more on its use?
$q = mssql_query("INSERT INTO TableName(...) VALUES(...) SELECT
LAST_IN
Sorry, I wasn't trying to fool you, I promise! :)
Arpad,
From looking on the web (MSDN) I found the @@identity and the explanation of
what it is, but MS's "example" is horrible and does not show a good context
for using this function. Could you elaborate more on its use?
On 2/14/07, Robert
On Wed, 2007-02-14 at 19:34 +0100, Tim wrote:
> >
> > -Message d'origine-
> > De : Tim [mailto:[EMAIL PROTECTED]
> >
> > > I hope that wasn't too confusing.
> >
> > http://cz2.php.net/manual/en/function.mysql-insert-id.php
>
> Sorry my eyes played some tricks on me ragarding mysql/mssql
> -Message d'origine-
> De : Tim [mailto:[EMAIL PROTECTED]
> Envoyé : mercredi 14 février 2007 19:28
> À : 'Dan Shirah'; 'php-general'
> Objet : RE: [PHP] Retrieve value of newly inserted row.
>
>
>
> > -Message d
On Wed, 2007-02-14 at 13:26 -0500, Robert Cummings wrote:
> On Wed, 2007-02-14 at 13:20 -0500, Dan Shirah wrote:
> > Hello,
> >
> > On my second insert statement, please note "credit_card_id". This is an
> > auto_increment column in table1. What I need to do is pull the value of
> > "credit_card
> -Message d'origine-
> De : Dan Shirah [mailto:[EMAIL PROTECTED]
> Envoyé : mercredi 14 février 2007 19:20
> À : php-general
> Objet : [PHP] Retrieve value of newly inserted row.
>
> Hello,
>
> I have a page the contains two insert statements.
>
Dan Shirah wrote:
On my second insert statement, please note "credit_card_id". This is an
auto_increment column in table1. What I need to do is pull the value of
"credit_card_id" from the newly inserted row from insert1 and put that
value
in a variable to assign it to "credit_card_id" in ins
On Wed, 2007-02-14 at 13:20 -0500, Dan Shirah wrote:
> Hello,
>
> On my second insert statement, please note "credit_card_id". This is an
> auto_increment column in table1. What I need to do is pull the value of
> "credit_card_id" from the newly inserted row from insert1 and put that value
> in
Hello,
I have a page the contains two insert statements.
$insert1 = "INSERT INTO table1 (
debit_card,
card_type,
card_number,
exp_date,
payment_amount,
cvv_number,
first_name,
middle_name,
last_name,
address_1,
address_2,
city,
zi
13 matches
Mail list logo