Narendra
  • Home
  • About
KEEP IN TOUCH

Caching problem with models in CakePHP

Sep24
2010
3 Comments Written by Narendra Vaghela

Before a few days, I was working on a project in CakePHP. I made some model related changes, like changed the relationship of models and added new fields to table in database.

After uploading the code to live server, when I checked the site, no difference was seen as compared to earlier version of site. I wondered what had happened. Where have all the changes gone or why no change has been applied even though I changed the code in models?

Everything was working fine, except that the changes in model and database were not reflected.

I contemplated a lot, then I realized that I should have cleared the cache of models.

So for that I deleted cache folder in /app/tmp/ and voila, everything worked fine. I had found the solution.

There is another trick [which actually does the same thing as above] for solving this problem :

> First change the debug level to 3 in your core.php file.
> Reload your application in browser.
> Change the debug level back to 0.

That’s it.

So remember, any time you add a new model or adjust your associations or make changes in structure of your database table, be sure to delete the cache folder from the /app/tmp/ folder.

Posted in CakePHP - Tagged CakePHP, models
« MySQL : Get next auto increment value in a MySQL table

3 Comments

  1. Pac's Gravatar Pac
    September 24, 2010 at 6:05 AM | Permalink

    Thanks a ton. Very helpful tips.

  2. Kapil's Gravatar Kapil
    September 25, 2010 at 10:29 AM | Permalink

    Hi,
    Very good article. Thanks for sharing.

  3. Shivraj Vaghela's Gravatar Shivraj Vaghela
    July 16, 2011 at 12:14 AM | Permalink

    Wahh bhai wahh
    Su vat 6

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Categories

  • CakePHP
  • Javascript
  • jQuery
  • MySQL
  • WordPress

Recent Posts

  • Caching problem with models in CakePHP
  • MySQL : Get next auto increment value in a MySQL table
  • Upgrade your WordPress site or blog for free..
  • Integrate WordPress into CakePHP
  • How to abort an ajax request using jQuery

Tags

ajax attribute bind event CakePHP component CSV getAttribute hidden iframe Javascript jQuery models MySQL recaptcha row selectbox setAttribute table visible wordpress

Useful Links

  • MyCakePHP
  • PacificWithin

EvoLve theme by Theme4Press  •  Powered by WordPress Narendra