hi all
i've been trying to add a new variable to a table - this variable will be 'order_number'. i initially tried INT UNSIGNED NOT NULL AUTO INCREMENT UNIQUE
when i try to alter the table i get the error
Incorrect table definition; ; There can only be one auto column and it must be defined as a key
--i am pretty sure i'm getting this error because the primary key to this db is 'userid' - which is also auto increment.
i would like to auto number order numbers. is there any way around this?
one thing to note: the app i am writing is such that nobody will be ordering more than two items, and they can only pay once for each item. so i was thinking of changing the data type from int to varchar - then making order number equal to userid+itema or userid+itemb.
are there any disadvantages to using varchar for order numbers? i'd rather use int but there doesn't seem to be a way around it in this case.
any advice you guys can give would be really appreciated
thanks
philosophia