Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    The plugin does not allow you to use a MySQL function call. But you have a couple options.

    1. Inbound: When a form is posted, you can concatenate these values into one value so that it is stored as a single field in the DB. There is an example of on this page.

    2. Outbound: Assuming the data is stored in different fields and you are using [cfdb-html] to display the data, you can effectively concatenate them:
    [cfdb-html form="form_name"]${hour_field}:${minute_fields} [/cfdb-html]

    I figure #1 is generally preferable.

    Mr. Bingo

    (@mr-bingo)

    I need to create a “record ID” for each entry in my database. If I create the form with an ID field, that field will show in the form, which I don’t want. I assumed that I could use this solution #1 above (or something like it). Is that true, or is there an alternate solution for establishing a record ID?

    Plugin Author Michael Simpson

    (@msimpson)

    The form submissions already have an id. It is the “submit_time” field which is just a number. When you look at the admin page you see “Submitted” which is that value formatted as a human readable date. “submit_time” is a timestamp of when the form was submitted down to the microsecond.

    In short codes you can output “submit_time” as well by adding it to “show” like [cfdb-table form="form_name" show="submit_time"]

    If you want to create your own ID, you would need to create a filter (#1 above) and add an “id” field like: $formData->posted_data['id'] = uniqid();

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Concatenate’ is closed to new replies.