PHP Classes
elePHPant
Icontem

File: display_example.php

Recommend this page to a friend!
  Classes of Ivan Melgrati  >  IAM CSV Dump  >  display_example.php  >  Download  
File: display_example.php
Role: Example script
Content type: text/plain
Description: Example File. Displays a CSV File created from a SQL Query
Class: IAM CSV Dump
Outputs SQL query results in the CSV format
Author: By
Last change:
Date: 16 years ago
Size: 2,307 bytes
 

 

Contents

Class file image Download
<?php
/**
 * EXAMPLE (iam_dsvdump)
 *
 * @author Iván Ariel Melgrati <phpclasses@imelgrat.mailshell.com>
 * @version 1.0
 * @package iam_csvdump
 *
 * A class form performing a query dump and sending it to the browser or setting it or download.
 * Requires PHP v 4.0+ and MySQL 3.23+
 *
 * Copyright (C) Iván Ariel Melgrati <phpclasses@imelgrat.mailshell.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 */


  #####################################################################################################################
  # Include the class #
  #####################################################################################################################
 
require_once("iam_csvdump.php");

 
#####################################################################################################################
  # Set the parameters: SQL Query, hostname, databasename, dbuser and password #
  #####################################################################################################################
 
$dumpfile = new iam_csvdump;

 
#####################################################################################################################
  # Call the CSV Dumping function and THAT'S IT!!!! The Query Result is sent to the browser #
  # as a CSV File (useful for debug purposes) #
  #####################################################################################################################
 
$dumpfile->dump("SELECT * FROM user", "", "", "mysql", "root", "", "localhost" );


?>