1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

DataWriter Replace Into?

Discussion in 'XenForo Development Discussions' started by robdog, Dec 17, 2013.

  1. robdog

    robdog Well-Known Member

    I have a primary key set for a column and I want to use the data writer to do a replace into. Has anyone attempted this before? Is the functionality already there? If so, what should the call order be?

  2. Marcus

    Marcus Well-Known Member

    You would have to check if the record exists, if not then save the data without setting setExistingData(). If the record already exists, you add setExistingData() to update your existing record.

    The model is there to use any functions, like "REPLACE INTO".

Share This Page