If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

My first look at PHPMyAdmin / MySQL

I'm messing around with databases and tables and I made a table names 'users' with columns like userid (primary & auto increment), username, etc, and I have one called verified which i set as a boolean (tinyint) and default value defined to 0. The problem is when I made this column it automatically tried to make it a primary key and require unique. I obviously don't want either of the 2 to be the case but it won't let me switch it! If I go in and edit the column and change it to text, however, it doesn't assume this PK value or the other things. I'm really confused why this keeps happening. Any ideas?

I'd guess so. Since using an autoincrement requires that the PK be in use, and that PK is not in gold, that would suggest that phpmyadmin uses gold to mark what is not a pk.
I haven't used phpmyadmin in a long long time. You could simply issue a SHOW CREATE TABLE yourtablename query and it will give you the text required to create it. That would indicate all your keys as well.

I'll be damned, this whole time I thought that you required PK for ai in mysql!
Would there be any benefit of doing the above instead versus swapping the PK and UK on that table? I typically don't use AI at all as I don't usually use a surrogate key, but this may become beneficial in the future for an alternate field I would want to increment.

Users who have thanked Old Pedant for this post:

Wow that was quite the process. Not sure what all went down but I must say I find it strange that the PK is denoted by a silver key. Seems as though it should be the gold. Anyways... I was clearly pressing SOMETHING wrong.. although I'm not sure what, I think it was successful this time. Really was not looking forward to re-installing. Does this look right to you too (the show turned up identical)? Also, does setting a value at the PK automatically set it as UNIQUE? Because it doesn't show unique I don't think.