Count, exclude row if empty field
-
Hi
Your code below works great for counting the number of submissions! I have another question now. How can I make the function to exclude rows that has a value in a certain column?
For example, in the form I have a field that is optional to fill in. If the field is left blank I don’t want to include this submission (the row in the database) in the count function.
require_once(ABSPATH . 'wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php'); $exp = new CFDBFormIterator(); $exp->export('Registration', array('show' => 'submit_time', 'trans' => 'CountField(submit_time)')); $count = 0; while ($row = $exp->nextRow()) { $count = $row['submit_time']; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Count, exclude row if empty field’ is closed to new replies.