Hello everyone,
I’m in the process of writing an extension that creates a new member profile field when a particular weblog entry is published. I’ve got the sql statements working for the most part, but when I view the profile fields in the EE CP the field ID is ‘0’ for the newly created fields. When I check my db table, though, the IDs are correct. It seems as though they only don’t display correctly in the CP.
Anybody have any suggestions? Here’s the code I’m using:
$DB->query("INSERT INTO exp_member_fields (m_field_id, m_field_name, m_field_label, m_field_type, m_field_list_items, m_field_ta_rows, m_field_maxl, m_field_width, m_field_search, m_field_required, m_field_public, m_field_reg, m_field_fmt) VALUES (NULL, '$m_field_name', '$m_field_label', 'text', 'No', '10', '100', '100%', 'y', 'n', 'y', 'n', 'none')");
$DB->query("ALTER table exp_member_data add column m_field_id_{$DB->insert_id} text NOT NULL");
Any help is appreciated - thanks!
-Manoj
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.