$main="\"name\",\"agclass\",\"sdate\",\"edate\",\"agcate\",\"agday\",\"agrem\"\n";//欄位名 $query="SELECT agent_tbl.*,tbase_tbl.name FROM agent_tbl,tbase_tbl WHERE agent_tbl.pid=tbase_tbl.pid ORDER BY agent_tbl.sdate ASC"; $sql=pg_query($query) or die($query); while($rows=pg_fetch_array($sql)){ $main.="\"{$rows[name]}\",\"{$rows[agclass]}\",\"{$rows[sdate]}\",\"{$rows[edate]}\",\"{$rows[agcate]}\",\"{$rows[agday]}\",\"{$rows[agrem]}\"\n"; } $filename=date("YmdHis"); header("Content-type: text/x-csv"); header("Content-Disposition: attachment; filename={$filename}.csv"); echo $main;
火狐不能跑...
回覆刪除我錯了...
回覆刪除ie、火狐、google 都OK