ON DUPLICATE KEY UPDATE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My question is with the syntax below: If the âON DUPLICATE KEY UPDATE `name` = '$name'â 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` = '$name';");

$_SESSION['referral_clients_reference'] = mysql_insert_id();

The Verse of the Day
âEncouragement from Godâs Wordâ
http://www.TheVerseOfTheDay.info

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux