Login   Register  
PHP Classes
elePHPant
Icontem

File: testclass.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of raju mazumder  >  Export To Excel  >  testclass.php  >  Download  
File: testclass.php
Role: Example script
Content type: text/plain
Description: Test file
Class: Export To Excel
Generate HTML tables from MySQL query results
Author: By
Last change: database script
Date: 6 years ago
Size: 1,495 bytes
 

Contents

Class file image Download
<?PHP
include_once('ExportToExcel.class.php');
include_once(
'databasecon.php');//to make database connecti
$exp=new ExportToExcel();
/*-------------un comment it to test with php page---------------
$exp->exportWithPage("export_file.php","personalinfo.xls");
*/

/*-------------un comment it to test with html page---------------
$exp->exportWithPage("export_html_file.html","personalinfo.xls");
*/

/*-------------un comment it to test with query------------
$qry="select * from personalinfo";
$exp->exportWithQuery($qry,"personalinfo.xls",$conn);
*/

/*
-- phpMyAdmin SQL Dump
-- version 2.9.2
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: Mar 03, 2008 at 06:42 AM
-- Server version: 5.0.27
-- PHP Version: 5.2.1
-- 
-- Database: `exceltest`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `personalinfo`
-- 

CREATE TABLE `personalinfo` (
  `vName` varchar(50) NOT NULL,
  `vEmail` varchar(50) NOT NULL,
  `vCity` varchar(50) NOT NULL,
  `ID` bigint(20) NOT NULL auto_increment,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `personalinfo`
-- 

INSERT INTO `personalinfo` (`vName`, `vEmail`, `vCity`, `ID`) VALUES 
('raju mazumder', 'rajuniit@gmail.com', 'Chittagong', 1),
('Anis Uddin Ahmed', 'anisniit@gmail.com', 'Chittagong', 2),
('Emran Hasan', 'ehasan@yahoo.com', 'Dhaka', 3);

*/

?>