Posts

Showing posts with the label data in excel

How to fetch data in excel or generate excel file in PHP

Image
  How to fetch data in excel or generate excel file in PHP File structure for this tutorial : config.php (database connection file) index.php (For fetching data) genrate-excel.php (For generating excel file) Create a SQL table tblemployee. Structure of sql table employe .   1 2 3 4 5 6 7 8 9 10 11 12 13 CREATE TABLE ` tblemploye ` (    ` id ` int ( 11 ) NOT NULL ,    ` fullName ` varchar ( 120 ) NOT NULL ,    ` emailId ` varchar ( 150 ) NOT NULL ,    ` phoneNumber ` int ( 11 ) NOT NULL ,    ` department ` varchar ( 100 ) NOT NULL ,    ` joiningDate ` varchar ( 100 ) NOT NULL ) ENGINE = InnoDB DEFAULT CHARSET = latin1 ; ALTER TABLE ` tblemploye `    ADD PRIMARY KEY ( ` id ` ) ; ALTER TABLE ` tblemploye `    MODIFY ` id ` int ( 11 ) NOT NULL AUTO_INCREMENT , AUTO_INCREMENT = 5 ; COMMIT ; Now insert some data into this table.   1 2 3 4 5 INSERT INTO ` tblemploye ` ...