Support » Plugin: Contact Form DB » different tables for for each choice

  • Resolved Panos

    (@panosk)


    Hello. I’am using my own short code as you instructed me in this topic Now I want to create lets say two different tables instead of one that will identified by a choice of a check box. In this example the check box is “delivery place”.
    Is this possible?

    require_once(ABSPATH . 'wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php');
    $exp = new CFDBFormIterator();
    $exp->export($atts['form'], $atts);
    echo '<table border="1">
    <thead>
    <<tr>
    <th>Name</th>
    <th>Oranges</th>
    <th> Delivery Place</th>
    </tr>
    </thead>
    <tbody>';
    
    $summary = 0;
    while ($row = $exp->nextRow()) {
        echo '<tr>';
        echo '<td>'. $row['name'] . '</td>';
        echo '<td>'. $row['oranges'] . '</td>';
        echo '<td>'. $row['delivery'] . '</td>';
        echo '</tr>';
           }

    Sorry for my bad English if wasn’t understandable tell me to explain again.

    http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/

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

    (@msimpson)

    Panos

    (@panosk)

    For the above code I added this to while loop

    while ($row = $exp->nextRow() && $row['delivey']=="Place 1") {
    echo '<tr>';
        echo '<td>'. $row['name'] . '</td>';
    }

    but it doesnt work
    Could someone tell me what I did wrong? I am newbie in programing.

    Plugin Author Michael Simpson

    (@msimpson)

    I think you want this:

    while ($row = $exp->nextRow()) {
       if ($row['delivey']=="Place 1") {
          echo '<tr>';
          echo '<td>'. $row['name'] . '</td>';
          echo '</tr>';
       }
    }
    Panos

    (@panosk)

    It worked. Thank you.
    Your support forum always very helpful.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘different tables for for each choice’ is closed to new replies.