I am editing a program regarding billing system done in Php and MySQL and generated using the Code Charge Studio. I have problem in validating a newly entered data. What i want is to check if the billing statement number is existing or not and will not saved after validation. Saving will be done after it has pass all the validation and when save button is click. If it is existing, there will be a message displaying that it will not accept the newly entered data for the fact that it is stored in the database. If the billing statement number is available, it will go next page and later will be saved.
Also please help me on how to erase the data stored in a variable to prevent inserting to database when refresh and Back button is pressed. please help.