Login   Register  
PHP Classes
elePHPant
Icontem

File: importtest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Harish Chauhan  >  MySql To Excel  >  importtest.php  >  Download  
File: importtest.php
Role: Example script
Content type: text/plain
Description: Example File
Class: MySql To Excel
Export data from a MySQL database to Excel files
Author: By
Last change: ImportDataFromFile is not in class. it is ImportDataFromTable so i chanfed it.
Date: 2005-01-15 02:55
Size: 542 bytes
 

Contents

Class file image Download
<?php
    
    
include("mysql_excel.inc.php");
    
    
$import=new HarImport();
    
$import->openDatabase("localhost","user","pwd","database");
    
    
//To import the data from table
    
$import->ImportDataFromTable("tablename");
    
    
//To import the data from sql query
    /*
    $sql="select r.user_name,p.amount from recruiter r ,payment p where p.user_name=r.user_name"
    $import->ImportData($sql,"myXls.xls");*/

    //To force to download
    //$import->ImportDataFromTable("graduate","",true);
    //Or
    //$import->ImportData($sql,"myXls.xls",true);

?>