mysql question
Posted by stuffradio, 03-22-2007, 01:21 AM I want to make a member id thing. Example: Member001 Member002 Member003 that would be insterted in to the database like that. How would I do that?
Posted by ergo, 03-22-2007, 03:59 AM why not name column memberId, make it unsigned integer, add primary key and auto_increment to it ? it will give you the exact effect
Posted by stuffradio, 03-22-2007, 02:33 PM if it's an integer characters like "Member" can't be in it.
Posted by ergo, 03-22-2007, 02:35 PM lol, im aware of that ;-) why would you need to put any string to identification field ? i think you are going in wrong area
Posted by stuffradio, 03-22-2007, 03:58 PM what do you mean "I think you are going in wrong area"? This is supposed to be for an ID on a sheet of paper that the member can be identified with as they walk through a door.
Posted by innova, 03-22-2007, 05:12 PM Go go gadget brain.. Do what ergo suggested, but when displaying it prepend the string 'Member' to it. Ala, echo 'Member' . $id; That wasnt so hard?
Posted by ergo, 03-22-2007, 05:16 PM thats exactly what i wanted to suggest ;-)
Posted by uptimedoctor, 03-22-2007, 09:14 PM In another words, the "Member" string is redundant and need not be stored in the database. Your DB will work faster (and easier) with an unsigned INT field than a text field.
Posted by stuffradio, 03-23-2007, 08:32 PM Thanks the way I did it is this... I just added another table called memberid, put one row in it, everytime someone registers there are 3 0's in front of it as well as Member. So it looks like the thing is Member0001 or Member0002 etc. Now I have another question.... Using the Paypal interface... how can I tell when a payment was submitted, and if the charge would be a year from the date... how can I add it to the database to tell it how much they owe, and the exact date that it's owed? I'm using the basic Paypal form that submits directly to paypal. Thanks
Posted by uptimedoctor, 03-23-2007, 11:57 PM Take a look at PayPal IPN - https://www.paypal.com/ipn . It's a lot of programming work to make your system fully automated. It is not easy to use if you aren't familiar with programming; get someone to help you in that case.
Posted by stuffradio, 03-24-2007, 12:06 AM well I'm familiar with programming, just not with the Paypal API
Posted by uptimedoctor, 03-24-2007, 12:07 AM Another comment: the 0's are redundant too. They are formatting and can be added with programming: echo sprintf("%04d", $memberid); Like said earlier, if you only want to use numbers for member ID, use unsigned INT.
Posted by Burhan, 03-24-2007, 03:03 AM Why? Why? Why? This is just ... ekh ... a few words come to mind but I'd rather not post them. You REALLY DO NOT NEED A TABLE to store PRINT FORMATTED INFORMATION. Please learn to properly use databases, as this will prevent many headaches down the road for you.
Posted by Xeentech, 03-24-2007, 05:29 AM I feel your pain, I get the impression you've worked with db's already populated in this fashion.. When ever I see a schema like this I really cringe from working with the functions that do the indexing and hashing.