Suggestions on MemberIds and ProductIds

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Suggestions on MemberIds and ProductIds

Post by raghavan20 »

I have designed a couple of websites where in,
MemberIds , I use prefix 'M' example ids: M1001
ProductIds, I use prefix 'P' example ids: P1001

do u think its good to use like this or just go for autocomplete?
Because mine is not scalable and I am putting extra code of no use?
But do u think autocomplete would never come up with a problem?

I welcome all ur comments.
Sphen001
Forum Contributor
Posts: 107
Joined: Thu Mar 10, 2005 12:24 pm
Location: Land of the Beaver

Post by Sphen001 »

Well, when I do stuff like that, I use the Auto Increment feature of MySQL. It works great for me. I also know of some people that just $id + 1. Whatever works for you is the best. As long as it's not slowing down your pages a lot, go for it.

Sphen001
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

From the point of database normalization: The prefixes 'M' and 'P' are completely redundant.
Post Reply