Ryze - Business Networking Buy Ethereum and Bitcoin
Get started with Cryptocurrency investing
Home Invite Friends Networks Friends classifieds
Home

Apply for Membership

About Ryze


The PHP developers network

Top [This Network is not currently active and cannot accept new posts]
<- Previous Next ->

600 hits
Oct 27, 2003 7:26 am re: Dilemma
Chris Hubbard
Will, Here's how I would do this: * in the database have a field for the account number, * in your php code create a function that creates account numbers in the format you want/like * in your php code create a function that checks to see if an account number is unique (as in, is it already in the database?) * on the form POST, check to see if the account field was filled in. If it was filled in, then make sure it's clean data (doesn't include the various characters that can break an application), if the data is clean, then call the function that checks that the number is unique. If it is, then use the user created account number to update the database. If the account number isn't unique, then you can either return the form to the user asking them for a new account number, or you could call the function that creates an account number. If the account name field wasn't filled in, call the create account number function. The create account number function generates an account number, and then calls the function that checks to see if the number is unique. Once you get an account number that is unique, use it to update the database. Hopefully this is clear for you, good luck. Chris > Will Hanke wrote: > I have a two-parter that maybe someone can help me with... >

>Situation:
>I have a client who wants to input new customers into his database. I've written a PHP form which allows him to do so.
>In the account number field, he can either type in the number, or have it auto-assigned. >

>Problem:
>When the client adds the info to the form and hits Submit... >

>1. How can I pull the list of account numbers, and verify that the one he entered is not already assigned? >

>2. How can I assign a 6-digit account number if he chooses auto-assign without duplicating an existing acct. number? >

>will >

Private Reply to Chris Hubbard (new win)





Ryze Admin - Support   |   About Ryze



© Ryze Limited. Ryze is a trademark of Ryze Limited.  Terms of Service, including the Privacy Policy