PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Pierpaolo   Resultset2xml   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: A simple example to show how it work
Class: Resultset2xml
Generate XML documents from MySQL query results
Author: By
Last change:
Date: 16 years ago
Size: 560 bytes


Class file image Download

// get here your recordset
$concertRecordset = mysql_query($query,$dbi);

// create the instance of the class
$resultset2xml = new Resultset2xml("concerts", "category", $concertRecordset, false);

// select the field you want: data and text are two fields of recordset (see documentation for details)
$resultset2xml->add_field("data", $resultset2xml->FIELD_DATE);
$resultset2xml->add_field("text", $resultset2xml->FIELD_TEXT, "phrase");

// print the xml on the page
echo $resultset2xml->getXml();