Jump to content

How do I check a membership number is unique before adding it to my database?


PHP_Idiot

Recommended Posts

I'm sure this must get asked a lot but I've searched here and googled but not found any answers yet!

Basically on my site I have an admin section that allows me to allocate new members a membership number, the membership number are broken into 3 sections region,venue,member (01-02-003 but without the -'s).

 

I need the form to check that the new membership entered on it does not already exist in hte database, if it does it needs to stop the submission and throw up an error message. If it's unique the submission can go ahead.

 

Any help would be really appreciated  :D

you run a select query with the new member number before doing the insert.

 

If the select query returns any rows, then the member number exists and you can flag the error, else you can go ahead and do the insert.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.