Forum Moderators: coopster

Message Too Old, No Replies

My table shows up weird in phpMyAdmin

a bunch of question marks

         

H2O_aa

11:40 pm on May 18, 2005 (gmt 0)

10+ Year Member



In phpMyAdmin, when you click on "browse", you will see a list of data in your table. By each row of data, there's a checkbox, a pencil (edit), an X (delete) and then follow by your fields.

Somehow, the X doesn't show up, instead they all turn into question marks. So I can't delete any field using the X icon. Also, the pencil icon only shows up on some rows. The rest turn into question marks too.

What's wrong with my table? I checked my other tables in the database and they all have the icons.

Timotheos

4:13 pm on May 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Weird. So are you saying the picture of the X is not loading or the picture is actually changed to a question mark? Can you still click on the question mark?

H2O_aa

5:32 pm on May 19, 2005 (gmt 0)

10+ Year Member



The pencil and X icons turned into question marks and I couldn't click over it. But I just noticed that when I hovered over those question marks, I got a message saying that i need to define a primary key. Once I did that, those question marks turned back into the corresponding icon.

I didn't know that a primary key is required for every table. I don't define a primary key every single time since I think it's not needed in all cases, but I guess I need to now.

Thank you for replying.

StuffOfInterest

5:58 pm on May 19, 2005 (gmt 0)

10+ Year Member



Makes sense. Without a primary key, phpMyAdmin (nor any database tool) will have no way to isolate operations down to a single row. You would have to do a generic query which could pickup multiple rows.

Timotheos

11:46 pm on May 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I didn't know that a primary key is required for every table. I don't define a primary key every single time since I think it's not needed in all cases, but I guess I need to now.

I've been thinking about this and I don't think it's true in general that a primary key is needed for every table. Correct me if I'm wrong.

The problem in phpMyAdmin is that the single row delete has to work off a unique value (i.e. a primary key) otherwise how would it know which condition to delete on up front. If you click the check box and then hit delete below then it uses the field data as conditions to delete.

coopster

11:50 pm on May 23, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I would concur. Primary keys are not required, but certainly make sense -- for the very reason(s) you described.