Support » Plugin: Contact Form DB » MYSQL version of shortcode

  • Hi Michael,

    I’m trying the manually pull data with MYSQL as it’s much quicker.

    Could you please help me convert this into MYSQL:

    [cfdb-value form="Schedule Tracker" unbuffered="true" linktext="Export Search Results (.CSV)" hide="Submitted Login,Submitted From,dynamicname" filter="submit_time>=$_POST(start)&&submit_time<=$_POST(end) 23:59&&Employee~~/.*$_POST(Employee).*/i&&Team~~/.*$_POST(Team).*/i&&voucher~~/.*$_POST(voucher).*/&&outcome~~/.*$_POST(outcome).*/i"]

    This is what I have so far:

    SELECT COUNT(*) FROM schedule_tracker_view WHERE (Employee = '$_POST[Employee]' XOR Employee IS NOT NULL) AND (Team = '$_POST[Team]' XOR Team IS NOT NULL)

    This works when I select all the fields that are included in the SQL query. When I select only one, it doesn’t work.

    I’ve created a new view from the original cf7db table.


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


    The filter expressions are sometimes evaluated in MySQL but in the case of regular expressions they are evaluated in PHP as a second pass over the results that MySQL returns. This is for parts of the filter that cannot be expressed in SQL. But maybe you can work out something that is close enough.

Viewing 1 replies (of 1 total)
  • The topic ‘MYSQL version of shortcode’ is closed to new replies.