Submitting the same value many times when the value needs to be unique
I have a form where I have 11 elements, for simplicity purposes I am going to show only three on here. 1 Member Name: => Text field 2 Membership Type: => Select options field 3 Invoice ID: => Text field. The requirement condition for this form is that the Invoice Id needs to be unique and has a post processor that checks if the Invoice Id already exists in the database. If the Invoice Id is in the database then the form submit returns an error or else it submits. Now the problem I am having with this is that sometimes the User needs to update or change the Membership type without touching the Invoice ID, in these circumstances the form needs to be submitted but the processor blocks it since the Invoice Id will already be in the database. Note: this form submits to the members table so there is auto increment id number for each record.
So I solved this issue with this way. Since this form relates to a member table, Each Record will have a unique ID. I modified the form post processer to check for every invoice id in the table but the current ID. This way I can make sure the form will be saved every time while having a unique invoice id for each record.
Simple DB Model
Autoload with namespaces in PHP 5.3?
PHP remove all caps
PHP Session_start is hanging
how do php share data without access a DB
How can I query two different databases in a single query using MySQL?
What's the correct way to reuse connections in case of PHP and MySQL?
Print the value in loop in Jquery ready function
PHP stdClass question
[PHP]: Error -> Too few arguments in sprintf();
how to implement conditional htmlspecialchars?
How to write a foreach that will produce the results I want
Where is extension being set?
Call a method from an included file NOT from file that inclued it php