Kimberly Johnson wrote:
> Webmin mysql "view data" shows the data and:
>
> Data in this table cannot be edited because it has no primary key.
To be able to edit (update/delete) a record you need a way to find to it. With a primary key it's easy, e.g.
UPDATE foo SET ... WHERE id = <some_value>
When you don't have a primary (or unique) key, there is no way to locate the record.
The best you can do in that case is
UPDATE foo SET col1 = 'newval1', col2 = 'newval2'
WHERE col1 = 'oldval1' AND col2 = 'oldval2'
LIMIT 1;
but this does not guarantee that you will update the correct record. So I guess that's the reason why webmin doesn't allow it.
There is an easy solution though: add a primary key to your table.
--
felix
Please use
BBCode to format your messages in this forum.