PHP_Idiot Posted February 21, 2010 Share Posted February 21, 2010 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 Link to comment https://forums.phpfreaks.com/topic/192795-how-do-i-check-a-membership-number-is-unique-before-adding-it-to-my-database/ Share on other sites More sharing options...
jl5501 Posted February 21, 2010 Share Posted February 21, 2010 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. Link to comment https://forums.phpfreaks.com/topic/192795-how-do-i-check-a-membership-number-is-unique-before-adding-it-to-my-database/#findComment-1015568 Share on other sites More sharing options...
PHP_Idiot Posted February 21, 2010 Author Share Posted February 21, 2010 Ah ok that makes sense thanks Link to comment https://forums.phpfreaks.com/topic/192795-how-do-i-check-a-membership-number-is-unique-before-adding-it-to-my-database/#findComment-1015572 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.