Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7943745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:21:40+00:00 2026-06-04T00:21:40+00:00

I have a custom mysql table we’ll call module_identifiers and a corresponding model in

  • 0

I have a custom mysql table we’ll call module_identifiers and a corresponding model in my module called Identifiers. This is my setup script:

$installer = $this;

$installer->startSetup();
$installer->run("
CREATE TABLE `{$installer->getTable('module_identifiers')}` (
  `module_identifier_id` int(11) NOT NULL AUTO_INCREMENT,
  `identifier` varchar(255) NOT NULL,
  `customer_id` int(11) unsigned NOT NULL,
  `profile_name` varchar(100) NOT NULL,
  `provider` varchar(50) NOT NULL,
  PRIMARY KEY (`module_identifier_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
");
$installer->endSetup();

In my Module/Model/Identifiers.php

class Namespace_Module_Model_Identifiers extends Mage_Core_Model_Abstract {

    protected function _construct() {
        $this->_init('module/identifiers');
    }

}

And in Module/Model/Mysql4/Identifiers.php

class Namespace_Module_Model_Mysql4_Identifiers extends Mage_Core_Model_Mysql4_Abstract {

    protected function _construct() {
        $this->_init('module/identifiers', 'module_identifier_id');
    }

}

So when I want to write to this table, I’ve been doing this:

Mage::getModel('module/identifiers')
    ->setIdentifier($profile['identifier'])
    ->setCustomerId($customer_id)
    ->save();

And that was working great until I added the provider and profile_name columns, and those are never updating with this:

Mage::getModel('module/identifiers')
    ->setIdentifier($profile['identifier'])
    ->setProvider($profile['provider'])
    ->setProfileName($profile['profile_name'])
    ->setCustomerId($customer_id)
    ->save();

I dropped my custom table, removed my module’s setup script from the core_resource list so it would run again (which it did), and the new rows are added to the database, but they’re missing the data for my new columns. Yes, I’ve verified that my $profile array has the correct data. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:21:41+00:00Added an answer on June 4, 2026 at 12:21 am

    If anyone ends up here looking for an answer to this very frustrating problem it is this.

    Magento caches its table descriptions in var/cache (even if you don’t have any caches switched on the backend) (see lib/Varien/Db/Adapter/Pdo/Mysql.php::describeTable()). When it goes to insert or update any table, it first checks this cache to see if it has a description of the table ready to go. If it finds one, it returns the cached description of the table, and if any of the fields in the array you pass to $model->save() don’t appear in this cached description, they won’t get inserted into the table, leading to the symptoms described above.

    So if you are fiddling about inserting columns in phpMyAdmin (or even re-running your setup script), Magento won’t see them and won’t insert your data.

    The absurdly simple solution is simply to do a rm -rf var/cache/*

    EDIT 2014.01.10: If your site makes use of memcache, this cache will need to be cleared as well for changes to take effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a custom table using custom module. I have been
I have created a custom module that creates a custom Database table. I have
Have next problem: i setup the custom session state server (store sessions in Mysql).
I have a sql installer file for my custom Magento module. It attempts to
I have an existing, non-framework-based PHP/MySQL website. It has a simple security model, with
I have this table in PostgreSQL: appid | appname | apptype | creationtime |
I have something that looks like this: my $report = new ReportGenerator; #custom object
I have a MySQL table which contains a list of all possible products a
I have set up a MySQL table multiple columns, one of which acts as
I have custom coded several enterprise applications for mid to large organizations to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.