I'm using Doctrine DBAL and wanting to do an INSERT ... ON DUPLICATE UPDATE
where the return is affected_rows. Seems like you can't use the standard Dbal executeUpdate since INSERT ... ON DUPLICATE UPDATE
and affected_rows are MySQL specific. That forces you to do a standard prepared SQL statement.
I'm using a Dependency Injection to insert the connection ( $this->connection ) into the class file. Should I be concerned about running an INSERT ... ON DUPLICATE UPDATE
and then doing a 2nd qry to get the affected_rows under these conditions.
There doesn't seems to be a race situation since the DBAL connection is built up and broken down on each page request. I'm using the Symfony2 framework in this case but the answer should help you regardless of what framework OR no-framework, you're using.