Jump to content
Sign in to follow this  
KateMacwil

Validiating Field Before Updating

Recommended Posts

Hi

I have a php page called "tenders-add.php" that allows the user to add a record to the "tenders" table. The first field in the table is called "ID" and this field needs to be unique.

In javascript, I have validated that the field is not empty, but I need to check somehow in my php code that this field is also unique to the table.

I am stuck on how to accomplish this.

tenders-add.php

Share this post


Link to post
Share on other sites

Look up records in the database with the value you're looking for in that field.  If it finds any records, then it already exists in the database.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×