Jump to content


Photo

index and unique


  • Please log in to reply
1 reply to this topic

#1 Neptunus Maris

Neptunus Maris
  • Members
  • PipPipPip
  • Advanced Member
  • 192 posts

Posted 14 October 2006 - 10:10 PM

I have a general understanding of what the unique column of a table is...

I need to know the difference between Unique and Index fields.  and please define them, my book doesnt go in dept.


Thanks in advance

Neptune

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 15 October 2006 - 09:40 AM

Exactly as it says on the tin. Values in a unique index cannot have duplicates. If the index comprises more than one column then the combination of values must be unique.

So if your current index values are , say
[pre]
blue |  1
blue |  2
red  |  1
red  |  3
[/pre]
you could add "blue, 3" but not another "blue, 2"
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users