Reply to Re: "you should define a primary key for this table" - why?

Your name:

Reply:


Posted by Bent Stigsen on 10/08/47 11:27

CAH wrote:
> I once wrote on usenet and got a very good answer . This one
>
> JN wrote:
>
>>>| Should one place all the text in one big table, or is i better to place
>>>| it in several tabels. Should one make 4 colums one for each language,
>>>| or 4 rows one for each language?
>>
>>I use:
>>CREATE TABLE `usr_languages` (
>> `pageName` varchar(25) default '',
>> `itemNo` int(11) default '0',
>> `en` text,
>> `fr` text,
>> `it` text
>>) TYPE=MyISAM COMMENT='different languages';
>
>
> which I used, and it works just fine, except that I just discovered
> that if I place just a litle more than a few line of text - in the TEXT
> fields then i get an "error" in phpmyadmin. There is a small question
> mark were thre is normally a pen and a cross - and when I move the
> cursur above the question mark i get this. "you should define a primary
> key for this table" .
>
> Do you have any suggestions as to what the problem might be?

I don't use phpmyadmin, but I assume that it would like to use the
primary key to make sensible select/update-statements. Apart from
that, it is just an advice for your own good.

Primary keys are to ensure integrity, but you get performance gains as
an added bonus, because you get the table indexed. In other words,
without a primary key (when applicable), you risk making a mess of
your data and having a crappy performance. But the choice is still up
to you. :)


/Bent

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация