RE: [PHP-DB] UPDATE instead of INSERT INTO

2009-09-08 Thread Daevid Vincent
:19 PM > > To: php-db@lists.php.net > > Subject: [PHP-DB] UPDATE instead of INSERT INTO > > > > I made an application which lets users rate web site content. > > At the heart of the application is this mySQL query: > > > > INSERT INTO `ratings` ( `refere

Re: [PHP-DB] UPDATE instead of INSERT INTO

2009-09-05 Thread Ron Piggott
Thanks - Original Message - From: "Waynn Lue" To: "Ron Piggott" ; Sent: Saturday, September 05, 2009 4:45 PM Subject: Re: [PHP-DB] UPDATE instead of INSERT INTO INSERT INTO ON DUPLICATE KEY UPDATE is what you're looking for. On 9/5/09, Ron Piggott wro

Re: [PHP-DB] UPDATE instead of INSERT INTO

2009-09-05 Thread Waynn Lue
INSERT INTO ON DUPLICATE KEY UPDATE is what you're looking for. On 9/5/09, Ron Piggott wrote: > I made an application which lets users rate web site content. At the heart > of the application is this mySQL query: > > INSERT INTO `ratings` ( `reference` , `content_type` , `content_reference` , > `

[PHP-DB] UPDATE instead of INSERT INTO

2009-09-05 Thread Ron Piggott
I made an application which lets users rate web site content. At the heart of the application is this mySQL query: INSERT INTO `ratings` ( `reference` , `content_type` , `content_reference` , `language` , `ip_address` , `rating_timestamp` , `rating` ) VALUES ( NULL , '$content_type','$content_