what does a ? mean in phpmyadmin next to a database row?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ramstein
Forum Newbie
Posts: 6
Joined: Mon Jul 03, 2006 7:44 pm
Location: SD, CA

what does a ? mean in phpmyadmin next to a database row?

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I would guess that you don't have a primary key defined for the table. Have you tried setting a PK?
ramstein
Forum Newbie
Posts: 6
Joined: Mon Jul 03, 2006 7:44 pm
Location: SD, CA

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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...
hydsharma
Forum Newbie
Posts: 1
Joined: Thu Jul 06, 2006 4:22 am

Need to use autoincrment as and when necessary

Post 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...
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post 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.
Post Reply