• Resolved remykonings

    (@remykonings)


    Hello!

    I’m looking to buy an annual subscription but before I do, I like to know if it’s possible to publish my Contact Form 7 submissions on the front-end based upon the logged in user.

    I’m using Ultimate Member for user accounts and I would like to publish the filtered database on a personal page of the user who is logged in.

    Hoping for some advice, thank you in advance.

    Remy

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Remy,

    >>> I like to know if it’s possible to publish my Contact Form 7 submissions on the front-end based upon the logged in user.

    Sorry, I have no idea! Perhaps you can ask the Contact Form 7 team? But I can confirm that you can use the WordPress user id in your WP Data Access queries if it is available in a custom table.

    Hope this helps. Let me know if you need further assistance.

    Best regards,
    Peter

    Thread Starter remykonings

    (@remykonings)

    Hi Peter,

    Thank you for the quick reply. Perhaps you can enlighten me if it’s possible to query the CF7 submissions table then.

    So I have a table where all CF7 submissions go into and is called: dFIg5brWz_cf7_data_entry.

    screenshot: https://ibb.co/xsKnyx0 (this is from 2 submissions)

    Currently that table has only single entries per value. Not sure if that is normal. I expected a single entry which holds all the values per submission. I can publish this table via your plugin but i’m not understanding how I can format/sort this table to my liking and based on the logged in user.

    Is the custom query the solution here to get that data and format it?

    Thank you.

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Remy,

    This looks like a custom post type structure. You could query that table like this:

    SELECT t1.value as 'company_name',
           t2.value as 'keuze', 
           t3.value as 'aanhef'
    FROM  dFIg5brWz_cf7_data_entry t1
          INNER JOIN dFIg5brWz_cf7_data_entry AS t2 ON t1.cfg_id  = t2.cfg_id AND t1.data_id = t2.data_id
          INNER JOIN dFIg5brWz_cf7_data_entry AS t3 ON t1.cfg_id = t3.cfg_id AND t1.data_id = t3.data_id
    WHERE t1.name = 'company_name'
      AND t2.name = 'keuze'
      AND t3.name = 'aanhef'

    This is for the first three columns only. You can add additional columns accordingly. I have no idea what cfg_id and data_id are for and if you need them, and I don’t know if you’re missing some information. If you want to be sure better ask the CF7 team…

    Hope this helps,
    Peter

    Thread Starter remykonings

    (@remykonings)

    I appreciate the help and will try it out. Thank you!

    Will buy a subscription today as well ??
    Have a good day!

    Thread Starter remykonings

    (@remykonings)

    I’m suspecting that i do something wrong as i’m getting an error.

    Screenshot: https://ibb.co/5KXWnfv

    Why would i want to query cfg.id and data.id? I’m not understanding well what these inner join do in this case.

    Is this possible or do i have the syntax wrong?
    SELECT t1.value as ‘company_name’,
    t2.value as ‘aanhef’
    FROM dFIg5brWz_cf7_data_entry t1,
    dFIg5brWz_cf7_data_entry t2
    WHERE t1.name = ‘company_name’,
    AND t2.name = ‘aanhef’

    • This reply was modified 2 years, 12 months ago by remykonings.
    • This reply was modified 2 years, 12 months ago by remykonings.
    • This reply was modified 2 years, 12 months ago by remykonings.
    • This reply was modified 2 years, 12 months ago by remykonings.
    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Remy,

    It looks like column cfg_id does not exist. Can you share a screenshot showing the columns for table dFIg5brWz_cf7_data_entry?

    desc dFIg5brWz_cf7_data_entry in the Query Builder will do

    Thanks,
    Peter

    Sure.
    This is the whole table. Only consisting of 5 columns:
    screenshot: https://ibb.co/GJjGWK3

    At first I expected this kind of table:
    screenshot: https://ibb.co/w7S7t0q

    but that is only when I install a database plugin to view the submissions.

    Thank you,
    Remy

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Remy,

    Looks like the column_name should be cf7_id instead cfg_id. Can you please change your query and try again?

    SELECT t1.value as 'company_name',
           t2.value as 'keuze', 
           t3.value as 'aanhef'
    FROM  dFIg5brWz_cf7_data_entry t1
          INNER JOIN dFIg5brWz_cf7_data_entry AS t2 ON t1.cf7_id  = t2.cf7_id AND t1.data_id = t2.data_id
          INNER JOIN dFIg5brWz_cf7_data_entry AS t3 ON t1.cf7_id = t3.cf7_id AND t1.data_id = t3.data_id
    WHERE t1.name = 'company_name'
      AND t2.name = 'keuze'
      AND t3.name = 'aanhef'

    Thanks,
    Peter

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Publish CF7 submissions on front-end’ is closed to new replies.