You cannot do it by "normal" means, as in MySQL configuration.
You can "simulate" it using code.
At most, you can create a 2 column configuration in a table, have a column with your alpha prefix and a second column with the auto_increment integer, than you set those fields together as the primary key. However, you will need to send the alpha prefix every time and the DB will do the integer auto_increment accordingly.
The best answer probably depends on what you mean by an alphanumeric ID. Does the alpha part increment in some way, and if so, what are the rules for that? If the alpha part is static, then you don't even need it in the DB: just prepend it to the numeric ID when you output it (perhaps using [s]printf() or similar functions to prepend zeroes so that it's a fixed length?). Without know the full requirement, though, we're all just speculating (or least I am).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
In that case I would go with my suggestion of just using an auto-increment integer column, then prepend the "ASP" part when actually outputting it to the user:
PHP Code:
printf('ASP%02d', $integerValueFromDatabase);
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks