PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 23, 2022

[FIXED] CakePHP looking for column that doesn't exist

 January 23, 2022     cakephp, cakephp-3.0     No comments   

Issue

So I removed a column from my users table as my application no longer uses it anywhere. I've made sure that there are no references anywhere in my code to this specific column. Yet, when I try to log in to the application I get Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Users.registered_through' in 'field list'.

I'm in debug mode, and I've made sure that there is nothing in my cache folder.

Just wondering why the application is still looking for a column that I have removed, and what I do to fix this?


Solution

why the application is still looking for a column that I have removed

By default Cakephp uses the file system for caching database schema data, if a different cache store is used, deleting the cache files won't have any effect.

what I do to fix this?

A cli is provided, the ORM Cache Shell, which can be used to clear or rebuild the relevant cached data:

# Clear all metadata
bin/cake orm_cache clear

# Clear a single table
bin/cake orm_cache clear articles


Answered By - AD7six
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing