การส่งออกเข้า Ms Excel จะส่งออกในรูปแบบของไฟล์ csv และสามารถเปิดด้วย
โปรแกรม Microsoft Excel ลองมาดูตัวอย่างกันหน่อยนะครับ
ชื่อฐานข้อมูล mydatabase
รายละเอียดของตาราง
CREATE TABLE `testing` (
`id` int(3) NOT NULL auto_increment,
`question` varchar(100) NOT NULL default '',
`c1` varchar(100) NOT NULL default '',
`c2` varchar(100) NOT NULL default '',
`c3` varchar(100) NOT NULL default '',
`c4` varchar(100) NOT NULL default '',
`answer` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=11 ;
#
# dump ตาราง `testing`
#
INSERT INTO `testing` VALUES (1, 'ข้อที่ 1', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 1);
INSERT INTO `testing` VALUES (2, 'ข้อที่ 2', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 2);
INSERT INTO `testing` VALUES (3, 'ข้อที่ 3', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 3);
INSERT INTO `testing` VALUES (4, 'ข้อที่ 4', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 4);
INSERT INTO `testing` VALUES (5, 'ข้อที่ 5', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 4);
INSERT INTO `testing` VALUES (6, 'ข้อที่ 6', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 3);
INSERT INTO `testing` VALUES (7, 'ข้อที่ 7', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 2);
INSERT INTO `testing` VALUES (8, 'ข้อที่ 8', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 1);
INSERT INTO `testing` VALUES (9, 'ข้อที่ 9', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 2);
INSERT INTO `testing` VALUES (10, 'ข้อที่ 10', 'ตัวเลือกที่ 1', 'ตัวเลือกที่ 2', 'ตัวเลือกที่ 3', 'ตัวเลือกที่ 4', 3);
Sample1.php
**Hidden Content: To see this hidden content your post count must be 6 or greater.**