Page 1 of 1
what does a ? mean in phpmyadmin next to a database row?
Posted: Thu Jul 06, 2006 2:06 am
by ramstein
I have a long database of user fields but most have no edit or X button next to the row, but a "?" instead.
When I rollover the "?" it says "you should define a primary key for this table". What does that mean? I noticed if i try to edit one of these, it doesnt save.
new to php/mysql obvioulsy.
thanks!
and also, how do i define one? thanks
Posted: Thu Jul 06, 2006 2:35 am
by RobertGonzalez
I would guess that you don't have a primary key defined for the table. Have you tried setting a PK?
Posted: Thu Jul 06, 2006 2:44 am
by ramstein
just set "ID" as PK. Works fine now thanks.
Found this.
http://help.scibit.com/Mascon/masconWha ... ould_.html
Can I somehow add an auto incremental key too a few hundred rows that already exist, or if i set auto inc, would it just effect all new adds going forward?
thanks
Posted: Thu Jul 06, 2006 3:20 am
by RobertGonzalez
I don't know if a table with existing data will allow an autoincrement. You could manually force one with some toggling between Excel and a text editor...
Need to use autoincrment as and when necessary
Posted: Thu Jul 06, 2006 4:29 am
by hydsharma
Its wise to use them as and when necessary..Not for avoiding a error..go through database conceots and you will know all...
Posted: Thu Jul 06, 2006 8:49 am
by jason
ramstein wrote:Can I somehow add an auto incremental key too a few hundred rows that already exist, or if i set auto inc, would it just effect all new adds going forward?
Yes.
Just make the field and auto_incremenet field, and MySQL will auto-populate it.