ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

I want to setup a script to automatically create member fields, anybody?

October 18, 2011 10:37am

Subscribe [2]
  • #1 / Oct 18, 2011 10:37am

    Tony Gurnick

    94 posts

    I have a test db with test data.

    Does anybody know the sql query that will create a new member field?

    this is so i can quickly setup dummy data

  • #2 / Oct 18, 2011 7:39pm

    lebisol

    2234 posts

    Create fields based of what? Column values in your test db?
    How many possible values/fields and…why not just use CP to make a few fields?

    Look into ‘exp_member_fields’ table.

  • #3 / Oct 18, 2011 8:10pm

    Tony Gurnick

    94 posts

    i want to create a member field.  not sure how i can say that more clearly.

    i want to create 1 to n fields - it really doesn’t matter

    Sure using the cp to do this is fine - if its only a few - but given its a test db and will by its nature be wiped frequently I would like to create fields via a script.

    what i guess i am asking is - is there just one table to update or does the process require a few tables being changed to achieve a custom field

    cheers
    tony

  • #4 / Oct 18, 2011 8:33pm

    lebisol

    2234 posts

    AFAIK
    - to define custom fields just add vales in ‘exp_member_fields’ table.
    - to populate those fields with data related to a member…look into ‘exp_member_data’ table.

    So 2 tables are involved, just not sure if you can do mass creation of accounts due to how passwords are stored. Might be easier to do a manual creation of accounts first them then just do an sql dump of 2 tables for later.
    Hope this gives enough direction…I have not tried this.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases