不需要用到 fputcsv 函数来生成报表。只需设置相应的格式和HTTP头信息,就能够生成报表了。附上代码:header("Content-type: application/vnd.ms-excel; charset=utf-8");header("Content-Disposition: attachment; filename=excel.xls");$data = "分类销售统计\t\n";$data .= "排名\t产品大类\t销售额(万)\t销售占比\t单品数量\n";if (EC_CHARSET == 'utf-8'){ echo ecs_iconv(EC_CHARSET, 'GB2312', $data);}else{ echo $data;}?>
先登陆服务器,找到自己的my.cnf文件,通常会在 /etc目录下(如果不在,可以用find / -name my.cnf命令找一下),然后使用 vi my.cnf 命令编辑该文件(建议先备份),在[mysqld]下面加上 skip-grant-tables ,作用是登陆时跳过登陆认证,换句话说就是root什么密码都可以登陆进去,然后:wq保存退出后,用service mysqld restart重启mysql。现在不论什么密码都可以登陆root用户了。接下来,在Linux中输入如下命令:mysql -uroot -pmysql> use mysql; mysql> update user set password=password('123') where user='root'; mysql> flush privileges; 退出mysql删除skip-grant-tables重启mysql,完成。转自:http://blog.csdn.net/daijiguo/article/details/52717862
导出数据库直接使用命令:mysqldump -u root -p abc >abc.sql然后回车输入密码就可以了;mysqldump -u 数据库链接用户名 -p 目标数据库 > 存储的文件名文件会导出到当前目录下导入数据库(sql文件)mysql -u 用户名 -p 数据库名 < 数据库名.sqlmysql -u abc -p abc < abc.sql注意sql文件必须在当前目录下,如果不在当前目录下需要在< 之后加上具体sql文件路径
1.mkdir a1mkdir b1mkdir c1cd a1mkdir a2mkdir b2cd c1mkdir c2mkdir d22.useradd aapasswd aauseradd bbpasswd bbuseradd ccpasswd ccgroupadd gggpasswd –a aa gggpasswd –a bb ggvi /etc/groupcp /etc/group /tmp/file1chown aa :gg /tmp/file1chmod 750 /tmp/file1ls –l3.vi chengji.cinclude<stdio.h>main(){int num;printf("plz ,input source!");scanf("%d",&num);if(num>=90) printf("A");if(num<90&&num>=80) printf("B");if(num<80&&num>=70) printf("C");if(num<70&&num>=60) pr
import java.awt.*; import java.awt.event.*; public class Tanke { public static void main(String[] args) { Frame w = new Frame(); w.setSize(1024, 768); // w.setBackground(Color.BLACK); MyPanel mp = new MyPanel(); w.add(mp); w.addKeyListener(mp); mp.addKeyListener(mp); w.show(); } } class MyPanel extends Panel implements KeyListener{ int x1,x,y,fx; public void pd(int fx,int x,int y,Graphics g){ if(fx==1){