PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Need the field names via SQL

  1. I have some sql I use to pull some reports out from the db tables.

    SELECT
    pziou_rg_form.id,
    pziou_rg_form.title,
    pziou_rg_lead.date_created,
    pziou_rg_lead.ip,
    pziou_rg_lead.source_url,
    pziou_rg_lead_detail.field_number,
    pziou_rg_lead_detail.<code>value</code>
    FROM
    pziou_rg_form
    INNER JOIN pziou_rg_lead ON pziou_rg_form.id = pziou_rg_lead.form_id
    INNER JOIN pziou_rg_lead_detail ON pziou_rg_lead.id = pziou_rg_lead_detail.lead_id

    Works well, but obviously the fields are only identified by the field number.

    How/Where can I get that data?

    I see the _meta table filled with serialized data, but I'm having a bit of trouble understanding how it's formatted. It looks like a multidimensional JSON array.

    Posted 12 years ago on Friday December 2, 2011 | Permalink
  2. Hi Scott,

    Your best bet will be to do some post processing to the returned data after you've retrieved it form the database. To get the form meta unserialized you can use this:

    [php]
    $form = RGFormsModel::get_form_meta($form_id);

    Then you could loop through the items of your returned data and drill down in the $form array to get the matching field ID and then the corresponding field label.

    Let me know if you have any other questions.

    Posted 12 years ago on Saturday December 3, 2011 | Permalink

This topic has been resolved and has been closed to new replies.