将具有相同名称的行中的表格单元格合并到wordpress

时间:2017-05-09 05:57:31

标签: database wordpress

campaign one    campaign description    [ybr_scode business_id="ippudo-singapore-3" review="blo" layout="hori"]  
campaign one    campaign description    [ybr_scode business_id="din-tai-fung-singapore-4" review="blo" layout="hori"]

这就是我想要的数据:

  campaign name       campaign desc             shortcode              
                                                                      action

                                                [ybr_scode business_id="ippudo-singapore-3" review="blo" layout="hori"]
campaign one      campaign description          [ybr_scode business_id="din-tai-fung-singapore-4" review="blo" layout="hori"]           print

可能代码是

global $wpdb;
                    $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ybr_yelp_business");
                    foreach ($rows as $row){
                        echo '<tr id="campaign_delete">
                        <td>'.$row->campaign_name.'</td>
                        <td>'.$row->campaign_text.'</td>
                        <td>[ybr_scode business_id="'.$row->business_id.'" review="'.$row->display_option.'" layout="'.$row->display_layout.'"]</td>
                        <td class="text-center"></td>

                             </tr>';
                    }

我在一个表中有数据,同时包含多行数据。我想创建一个表,其中同一行的所有数据显示在同一行,并且日期显示在同一行

0 个答案:

没有答案