Create a unique id and add that to mysql database
Posted: Tue Feb 22, 2011 3:42 pm
Hi guys...
I need to generate a 3-4 letter unique id and add it to a database.
I'm not sure how many characters there is, that I can use (I'm guessing around 128 or 256)... If there's around 100, 3 digits would be enough.
So, here'e what I need it for:
I have a php script that adds a records to a "log-database" each time it's activated. Now, I want to add a unique id also... I son't think I can use the "id" field from the mysql databse, because it's only numbers and that wouldn't be enough....
Also, I need the ID before I save the data to the database.
Any ideas?
I need to generate a 3-4 letter unique id and add it to a database.
I'm not sure how many characters there is, that I can use (I'm guessing around 128 or 256)... If there's around 100, 3 digits would be enough.
So, here'e what I need it for:
I have a php script that adds a records to a "log-database" each time it's activated. Now, I want to add a unique id also... I son't think I can use the "id" field from the mysql databse, because it's only numbers and that wouldn't be enough....
Also, I need the ID before I save the data to the database.
Any ideas?