Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: customer code

  1. #1
    New Coder
    Join Date
    Sep 2005
    Location
    Steger, IL
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question customer code

    I am probably thinking about this too much (as usual), but lets say I create database to hold client information (fname, lname, street, city, state, zipcode, phone, email) and I want a customer code to enter automatically each time I enter a client and increment off the last number (ie John Doe was entered and assigned customer code 0001 and I enter John Smith and I want it to automatically make that 0002). That would be the primary key and unique in the database if I am not mistaken, but what PHP is necessary to do this part of it. I already have the form, php, etc... for the rest of the data entry.

    thanks,

    Jim
    Jim

  • #2
    Regular Coder
    Join Date
    Sep 2005
    Posts
    394
    Thanks
    1
    Thanked 0 Times in 0 Posts
    This is simple sql. Just set the ID field as auto_increment, then don't insert a value into it manually, and it will auto give you numbers.

    ~Phil~


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •