mysql_affected_rows and ON DUPLICATE KEY UPDATE

mysql_affected_rows and ON DUPLICATE KEY UPDATE

Posted by: crimsondryad
Posted on: 2007-07-01 16:30:00

Hi, I'm having a strange issue and I wonder if anyone else has run into this. I'm using MySQL 5.1+ and I'm using insert syntax with "On Duplicate Key Update" so if the record exists it's just updated. The record is actually updating, but mysql_affected_rows is returning 0, which would indicate that the record isn't updated (though it has been).

Anyone have any ideas?

================================
Angela Gann
CrimsonDryad Web Design Services
Web Design, Custom Software Development
http://www.crimsondryad.com

Tags: custom software developmentweb design servicesservices web designdesign custom softwareduplicategannangelasyntax