wp contact form7 db plugin custom where query with where condition

时间:2017-01-16 06:57:56

标签: php wordpress contact-form-7

我已经使用contactform7插件安装了contact form DB

我已经在项目名称中创建了表单。在这里,我已经以hid_postid

的名义隐藏了帖子ID

我在主题文件中使用了以下代码

SELECT  submit_time, 
    DATE_FORMAT(FROM_UNIXTIME(submit_time), '%b %e, %Y  %l:%i %p') AS Submitted,
    MAX(IF(field_name='fullname', field_value, NULL )) AS 'Name',
    MAX(IF(field_name='email', field_value, NULL )) AS 'Email',
    MAX(IF(field_name='telphone', field_value, NULL )) AS 'TelephoneNumber',
    MAX(IF(field_name='hidposttitle', field_value, NULL )) AS 'PostTitle',
    MAX(IF(field_name='hidpostid', field_value, NULL )) AS 'PostId',
    MAX(IF(field_name='hidstatus', field_value, NULL )) AS 'Status' 
    FROM wp_cf7dbplugin_submits
    WHERE
    form_name = 'Projects'  GROUP BY submit_time
    ORDER BY submit_time DESC

这里我想将where条件应用为hidpostid = 303。我试过很多方面,但没有任何结果。

任何人都可以帮助解决这个问题。谢谢

0 个答案:

没有答案