Hello,

I am trying to build a module which is supposed to store some datas in the database. There for, I made a .install file which looks like that :

<?php
function mailcatcher_schema()
{
  $schema['mailcatcher_contacts'] = array(
    'description' => 'Contacts from {mailcatcher_contacts}.',
    'fields' => array(
      'mcid' => array(
        'description' => 'Primary key: Unique subscription ID.',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'mail' => array(
        'description' => 'The email address.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
  );
}

function mailcatcher_install()
{
  drupal_install_schema('mailcatcher_schema');
}

function mailcatcher_uninstall()
{
  drupal_uninstall_schema('mailcatcher_schema');
}

Can somebody tell me what I am doing wrong ?

logs :

warning: Invalid argument supplied for foreach() in /var/www/lab/includes/common.inc on line 3389.
warning: Invalid argument supplied for foreach() in /var/www/lab/includes/common.inc on line 3310.

Comments

mikou’s picture

I solved the problem.

I forgot the $return.