Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleFeedback POST request with Text Tag
linenumberstrue
<?xml version="1.0" encoding="UTF-8" ?>
<Resource xmlns="http://xml.metamug.net/resource/1.0" v="1.0">
	<Request method="POST">
	    <Sql id="addFeedback" type="update">
          INSERT into feedback (name,email,issue,description) VALUES 
          ($name,$email,$issue,$description) 
      	</Sql>
      	<Sql id="addUser" type="update"> 
          	INSERT IGNORE INTO feedback_user(emailUsers,registration_source) VALUES ($email,'product-feedback')
      	</Sql>
      <Text id="feedback">
      	name: $name,feedback: $issue - $description
      </Text>
	</Request>
</Resource>


Inserting Duplicate Records

addUser  ignores duplicate inserts preventing the POST API from failing in case the user already exists in the table.

...