I want to add new column into magento database and want to insert new data into newly created column. Basically what exact i want to do is that when new customer register in my webstore. i want to generate a temporary account number when customer click on register button. on the next page this number will be appear written as temporary account number is = ....... for this purpose i think i need to create a new column in database to store the temporary account number.

1 Answer 1


The customer data is based on EAV, this means you'll need to add an attribute to the attribute set instead of a table column.

There are a couple of tutorials on that, check out this one and this one. It comes down to creating your own module with an install script that has something like this

$installer = $this;

$installer->addAttribute('customer', 'temp_id', array(
    'type' => 'varchar',
    'input' => 'text',
    'label' => 'Temporary ID',
    'global' => 1,
    'visible' => 1,
    'required' => 0,
    'user_defined' => 0,
    'default' => '',
    'visible_on_front' => 0,
    'source' => NULL,



        </your_module_identifier >

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.