This question about Using an extension: Answered

Database plugin INSERT INTO problem

Hi

When I use the following code:
%DATABASE_SQL{description="projectdatabase" sql="INSERT INTO example (name, age) VALUES('Henro Ritchie','28')"}%

It inserts duplicate entries into the table. It should only insert one entry.


Update - I solved my query.

Firstly use SQL plugin instead of DATABASE plugin. SQL plugin works easier.

Secondly, when using FormPlugin, be careful of the validate setting in the form. If unsure make sure the validate="off" parameter is set. It might be that the validate part submit the query a second time and thus the double record entry into the table.

-- HenroRitchie - 26 Apr 2012

QuestionForm edit

Subject Using an extension
Extension DatabasePlugin
Version Foswiki 1.0.9
Status Answered
Related Topics
Topic revision: r3 - 26 Apr 2012, ArthurClemens - This page was cached on 22 Jun 2019 - 16:10.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy