Cliff Hirsch wrote:

> Apologies if this should be in the MySQL list, but it does seem to be a
> PHP-level issue.
> 
> While testing, I just did a page refresh, which caused this action to be
> repeated:
> 
> $query_string = "INSERT INTO task_category (task_id, category_id) VALUES
> ($taskId, $categoryId)";
> $this->dbManager->DbQuery($query_string);
> 

Depending on your versioning and app-flow, you can either do a SELECT first
to see if your key exists, or something like:

INSERT INTO table(primaryKey,someData) VALUES (1234, 'test')
ON DUPLICATE KEY UPDATE someData = VALUES('test');


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to