AboutRobert Davis Expertise My focus in PHP has been calculations, reporting, database manipulation (MySQL), automated scripting, screen scraping, and tracking systems. A more complete summary is posted at http://businesscatalyst.info.
Experience I've been programming in many languages for over 13 years, but the last couple years I've focused on php. I've posted several tricks I've learned at goodfeelingplace.com.
Education/Credentials I have a bachelors degree and a masters degree, both in electrical engineering from Arizona State University.
Question Hi Robert,i'm creating the store from scratch with codeigniter..Are there any disadvantage with using autoincrement index?I've been thinking about creating a table that holds the number using varchar instead of int,i get the number from the table then i update it again if there are a transactions..But in another way,i've been thinking does it consume resources as i have to convert the string to int first and then convert it again.What is your suggestion?Thanks a lot and God bless you. ^_^
Answer Hi Handoyo,
If you are doing it from scratch I would definitely recommend an autoincremented ID as the invoice number, as you know it will be unique and it is light on resources. The only reasons I would do it another way is if you wanted to make the invoice number mean something, by including other info in it like customer ID/code, date, etc. - or if you needed it to be random or encoded for some reason.
Regards,
Robert