Updating Form Values Only If Not Existing In Database
<p>Suppose I have a form like this-</p>

<pre><code>&lt;form method="post" action="process.php"&gt;    
   Mark Up Name &lt;input type="text" name="mark_up_name"&gt;
   Minimum Rate &lt;input type="text" name="mark_up_min"&gt;
   Maximum Rate &lt;input type="text" name="mark_up_max"&gt;
   &lt;input type="submit" value="Save Mark Up"&gt;
&lt;/form&gt;
</code></pre>

<p>There will be many mark ups and when user edits a particular mark up and clicks on 'Save Mark Up' there will be a background check to see whether there's already a mark up with that name in database. If there is, then a message will be shown to user that Mark Up with that name already and exists. If not, then go ahead with the Update.</p>

<p>Alls well upto here. But when user tries to update other values like Minimum Rate or Maximum Rate, keeping the mark up value same, the message is still shown as Mark Up exists. Since database check returned true.</p>

<p>I am wondering what logic I need to apply here to get this resolved..</p>

<p>I tried</p>

<pre><code>if (CheckIfMarkUpExists($_POST['mark_up_name']))
{
   //Dont Update. Show Message MarkUp Exists
}
else
{
   //Update. Show Message MarkUp Saved
}
</code></pre>
