php


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.

Related Links

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?
Javascript & jQuery escaping quotes
Possible to add javascript to Zend_Form_Element_Radio?
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

Categories

HOME
flask
magento2
matrix
ontouchlistener
focus
writefile
command-prompt
implicit-conversion
chromecast
cuba-platform
fresco
rpmbuild
http-authentication
sqlplus
opentext
tracing
prompt
fstar
echosign
sendmessage
sparkle
ibm-connections
mdns
cloudera-manager
gnu-classpath
grails-2.5
busboy
uivisualeffectview
cheat-engine
word-cloud
bit-shift
section508
renderman
mura
.when
dojo-build
wicked-pdf
processor
polymerfire
gulp-uglify
as3-api
onepage-checkout
flush
voronoi
flask-security
bayesglm
dsa
netdatacontractserializer
featuretoggle
embeddedwebserver
com0com
subfolder
python-curses
android-audiomanager
kognitio-wx2
google-hangouts
nesper
boolean-algebra
gpu-programming
property-injection
spring-social-linkedin
saga
cyrillic
playorm
audiotoolbox
instance-variables
clearinterval
autosize
mvcrecaptcha
rtd
upshot
regression-testing
eaccelerator
multiple-users
tessellation
downcasting
xap
efs
version-control-migration
datagridcolumn

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App