Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // retrieving submissions
- $post_id = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "postmeta WHERE meta_key = '_form_id' and meta_value = 2");
- foreach ($post_id as $value) {
- $printf .= "<tr>";
- $sql = "SELECT meta_key, meta_value FROM " . $wpdb->prefix . "postmeta WHERE post_id = " . $value->post_id . " AND meta_key LIKE '_field_%'";
- $results = $wpdb->get_results($sql);
- $data = array(
- '1' => '',
- '2' => '',
- '3' => '',
- '4' => '',
- );
- foreach($results as $print){
- if($print->meta_key == '_field_11')
- $data['1'] = $print->meta_value;
- if($print->meta_key == '_field_30')
- $data['2'] = $print->meta_value;
- if($print->meta_key == '_field_12')
- $data['3'] = $print->meta_value;
- if($print->meta_key == '_field_8')
- $data['4'] = $print->meta_value;
- }
- foreach ($data as $print) {
- $printf .= "<td width='25%'>$print</td>";
- }
- $printf .= "</tr>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement