Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

just need a little advice...again

Codes here !

Moderators: macek, egami, gesf

just need a little advice...again

Postby faust » Sat Jun 23, 2012 8:38 am

Hey guys, I was just curious. I know that you should always have a unique field in your tables but should you always have a auto increment field? Like id or something? Because if you for example, have table 'products' with catalog codes, each code will be unique, so you actually don't need the auto inc field, right? Just looking for best practices :)
faust
New php-forum User
New php-forum User
 
Posts: 109
Joined: Thu May 03, 2012 7:22 am

Re: just need a little advice...again

Postby mohdharulladtfi » Sat Jun 23, 2012 7:24 pm

for me,i using a primary id for each table..example product,i using ProductID for auto increment and catalog codes in other field..i use like this because it easy to refer when we need use 'product' table just using it id.. :)
mohdharulladtfi
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sat Jun 23, 2012 6:55 pm


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.