Trying to create dynamic fields in hook_install $schema database function
Posted by kavita_rs on January 26, 2011 at 4:26am
Hi there,
I am new to Drupal and trying to create a database with a dynamic number of fields depending on one of the field inputs. So, I have an input called "num" and then I want to ask for names for a "num" number of times. Here is what I wrote but it is not working. Any ideas?
/**
* Implementation of hook_schema()
*/
function add_family_schema() {
$schema['add_fam'] = array(
'description' => t('Stores the family information.'),
'fields' => array(
'num' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,