Database issues

Status
Not open for further replies.

loyalg

Member
Messages
46
Reaction score
0
Points
6
I noticed an update on phpmyadmin, It used to load all tables at the left side of the screen but for some reason it only loads half of my db at the left side.
But when i click on structure i can access the missing tables. Now also when clicking on certain tables it gives me a notice.

dot.gif
This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.


The notice above is given on more tables i click on.
Can anyone help me or explain to me why this is and how i can edit the table and give it a unique column.
Cause i really need to use these features in order to perform a reset, am not experienced enough to find the problem my self.

Thank you community
Stef
 

bradleyx

Member
Messages
108
Reaction score
1
Points
18
This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available. means that the table is either missing or invalid primary key to it.

what query where you trying to run:

if you run it like this:

SELECT * From example it will come up with a error as it has no primary record to show for editing, update or delete.

each database table needs atleast one primary key and to my opinion it should really only have one primary key.

if we had more info to go on tho we could help like:
what sql command where u were using (SELECT title from example)
or was you trying to change the table id or format.
 

loyalg

Member
Messages
46
Reaction score
0
Points
6
I dont really understand what you are trying to explain, Sorry.
I noticed that PHPmyadmin has been updated and before i always had edit,delete,copy etc in every table of my database but since the update it hasnt.
Like its totally gone and like i said i am a beginner so wouldnt know where to look to correct the problem :cry:
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
The problem is the table structure (or at least the problem that phpMyAdmin is complaining about is the table structure). It's telling you that it can't uniquely identify any rows in the table, or, rather, that it can't guarantee that it can uniquely identify any rows in the table, so it's dangerous to do anything other than read the data or insert new rows. (Update and delete operations might affect different rows than the ones you want to work with.) Even if the data in the column is actually unique per row, it isn't unique to the database engine until you tell it that it's unique.

At least one of the columns in the table needs to have the "Index" attribute (on the table definition/structure page in phpMyAdmin) set to "PRIMARY" or "UNIQUE" for those view/editing options to be available to you. (Every table should normally have a PRIMARY, even if it's an artificial one that's never actually used for anything.) That will issue an ALTER TABLE query behind the scenes, so if there is any amount of data in the table, you may want to have a beverage handy. If there is no data column that you can guarantee will be unique, then you'll need to add a column - something like an not-null auto-incremented integer - that you can guarantee will be unique.
 
Status
Not open for further replies.
Top