I've modified my schema so that I can store an array of items in one field:
"required_product" => array(
"type" => "text",
"length" => 'medium',
"not null" => TRUE,
"default" => "",
"serialize" => true,
),
This works great when using drupal_write_record, as the array data is correctly serialized before putting it into insert/update query and executing.
However, I still have to manually unserialize when I extract the data:
$form_state["values"] = db_fetch_array(db_query("SELECT * FROM {amh_shop_discounts} WHERE discount_id=%d", $discount_id));
$form_state['values']['required_product'] = unserialize($form_state['values']['required_product']);
This is less useful - shouldn't it do both?
Currently running Drupal 6.22