php實現匯出資料分類合併儲存格功能

來源:互聯網
上載者:User
 1 12             資訊統計表13                14                     15                         單位16                         負責人17                     18                19               20               ';21                while($row = mysql_fetch_array($result)) {22                    $gw = explode(",",$row['gw']);23                    echo '24                    25                        '.$row['danwei'].'26                        '.iconv("gbk","utf-8",$gw[0]).'27                    28                    ';29                     if($row['num'] > 1){30                         for($i=1;$i<$row['num'];$i++){31                             echo ''.iconv("gbk","utf-8",$gw[$i]).'';32                         }33                     }else{34 35                     }36 37                }38 39 echo '40             41         42     ';43 ?>

 1 CREATE TABLE IF NOT EXISTS `dy` ( 2   `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 3   `danwei` varchar(30) NOT NULL, 4   `fuze` varchar(30) NOT NULL, 5   PRIMARY KEY (`id`) 6 ) ENGINE=MyISAM  DEFAULT CHARSET=gbk AUTO_INCREMENT=7 ; 7  8 -- 9 -- 轉存表中的資料 `dy`10 --11 12 INSERT INTO `dy` (`id`, `danwei`, `fuze`) VALUES13 (1, 'a', '小張'),14 (2, 'a', '小孫'),15 (3, 'b', '小王'),16 (4, 'c', '小李'),17 (5, 'a', '小紅'),18 (6, 'b', '小趙');

功能實現預覽:

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.