ON DUPLICATE KEY UPDATE
am 28.11.2010 02:40:45 von ron.piggott
------=_NextPart_000_0000_01CB8E73.5DD6E9E0
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
My question is with the syntax below: If the â=9CON DUPLICATE KEY =
UPDATE `name` =3D '$name'â=9D occurs will =
$_SESSION['referral_clients_reference'] be populated with the =
mysql_insert_id() value? If not, should I just query for it? Ron
mysql_query("INSERT INTO `referral_clients` ( `reference` , `name` , =
`paypal_email` , `last_update` ) VALUES ( NULL , '$name', =
'$paypal_email', CURRENT_TIMESTAMP ) ON DUPLICATE KEY UPDATE `name` =3D =
'$name';");
$_SESSION['referral_clients_reference'] =3D mysql_insert_id();
The Verse of the Day
â=9CEncouragement from Godâ=99s Wordâ=9D
http://www.TheVerseOfTheDay.info
------=_NextPart_000_0000_01CB8E73.5DD6E9E0--
Re: ON DUPLICATE KEY UPDATE
am 28.11.2010 03:16:49 von Kesavan Rengarajan
--0015174be29e8f33830496138d9f
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
Read through this:
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.h tml, especially
the last 2 paragraphs.
On Sun, Nov 28, 2010 at 12:40 PM, Ron Piggott <
ron.piggott@actsministries.org> wrote:
> My question is with the syntax below: If the =93ON DUPLICATE KEY UPDATE
> `name` =3D '$name'=94 occurs will $_SESSION['referral_clients_reference']=
be
> populated with the mysql_insert_id() value? If not, should I just query =
for
> it? Ron
>
> mysql_query("INSERT INTO `referral_clients` ( `reference` , `name` ,
> `paypal_email` , `last_update` ) VALUES ( NULL , '$name', '$paypal_email'=
,
> CURRENT_TIMESTAMP ) ON DUPLICATE KEY UPDATE `name` =3D '$name';");
>
> $_SESSION['referral_clients_reference'] =3D mysql_insert_id();
>
> The Verse of the Day
> =93Encouragement from God=92s Word=94
> http://www.TheVerseOfTheDay.info
--0015174be29e8f33830496138d9f--