Firstly, this question has kind of been asked before here.
The problem is that after creating a new column by using ALTER TABLE
, a new column does get created, but sometimes it isn't shown in the structure tab. When it occurs, using SELECT * FROM <tablename>
does not display that column but SELECT <columnname> FROM <tablename>
does. All queries on that column work perfectly.
Solution to this problem was rightly posted and it was simple -- to export that complete table, drop it and then import it again.
My question is why does such a thing happen? It's really a nuisance. It isn't a problem when working locally, I can always import/export/drop, but what I have a piece of code that continuously drops/creates new columns? Why does this happen and why does an import/drop/export do the trick? Is it a bug with phpMyAdmin?
PS: I am using phpMyAdmin with XAMPP v3.2.1 on localhost.
Marc Delisle points out that the column may be hidden within phpMyAdmin; in the Browse tab look to the left of the column headers, there's a T with two arrows -- to the right of that is a small dropdown arrow. Make sure all your columns are selected there.
Click on the table you wish to modify. Inside the table, you will see a list of columns. To the right of the column name, you will see a link called "Change" under the Actions. Click on the Change link for the column you wish to modify.
It looks to me like your bumping into this known issue: http://sourceforge.net/p/phpmyadmin/bugs/4187/
The update goes to cache and therefore teh select * would come from cache versus the select "explicit column" which would pull directly from the DB. I'd imagine the export > drop > re-import process clears the cache with the drop.
Looks like its fixed in 4.1.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With