I'm abit unsure what you're trying to do. Let me get this right...
1) User fills in a form on your website and submits the info.
2) Somebody at the office picks up the request and manually assigns the user with a number.
3) This number is tagged on to the user's record in the DB or a record is created with all the info (inc. number).
I have no idea what this number is - I assume it has some meaning as it seems that it can be re-used - so it's not a unique identifier / primary key.
user_id (pk|int)
username (varchar)
user_number (int)
You can use COUNT and GROUP BY clauses in your SQL to get a list of unique numbers and the number of times that they appear in the table. Have a look at the mysql manual for examples of usage:
http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_count
diafol
Keep Smiling
10,842 posts since Oct 2006
Reputation Points: 1,675
Solved Threads: 1,536
Skill Endorsements: 61
So an user can receive multiple numbers. I didn't realise that. OK in that case:
user table:
user_id (PK, int)
username (varchar)
...
numbers table
supply_id (PK - optional)
user_id (FK, int)
supplied_num (varchar!)
Then do the COUNT / GROUP BY. I'd use an inner join for linking both tables in the query.
diafol
Keep Smiling
10,842 posts since Oct 2006
Reputation Points: 1,675
Solved Threads: 1,536
Skill Endorsements: 61