31 Mar
2008
31 Mar
'08
6:13 p.m.
Quoting John Fiala <jcfiala@gmail.com>:
On Mon, Mar 31, 2008 at 6:43 AM, LluĂs <enboig@gmail.com> wrote:
I need to save a value inside a table; I think the best/fast way of doing so is:
Personally I like to keep track internally if a row's been saved to the db or not - but I've seen some folks try the UPDATE statement, call db_affected_rows to see if any rows were changed, and if none were, to do the insert.
Doesn't work if data is the same; no rows will be updated and db_affected_rows will return 0. The method the OP used is correct insert else update. Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/