PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Rodrigo Reis  >  xmlDB  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: The example of use
Class: xmlDB
Manipulate XML files like a database
Author: By
Last change:
Date: 5 years ago
Size: 857 bytes
 

Contents

Class file image Download
<?php

include("xmlDB.class.php");

$xml = new xmlDB("file.xml", "user");

// uncomment the lines below to activate the functions of the class.

// INSERT PROCEDURE:
/*
$user = array();
$user["code"] = 1;
$user["name"] = "John Doe";
$user["email"] = "john@doe.com";
$xml ->addItem($user);
*/




// RETRIVE ONDE RECORD:
/*
$user = array();
$user = $xml -> find(1);

foreach ($user as $key => $value) {
    printf("%s: %s <br>", $key, $value);
}
*/




// RETRIVE ALL RECORDS
/*
$user = $xml -> xmlContent;

foreach ($user as $key => $value) {

    foreach ($value as $vKey => $vValue) {
        printf("%s: %s <br>", $vkey, $vvalue);
    }
    print("<br>");
}
*/




// EDIT PROCEDURE:
/*
$user = array();
$user["code"] = 1;
$user["name"] = "Carl Doe";
$user["email"] = "Carl@doe.com";
$xml -> editItem(1, $user);
*/




// DELETE PROCEDURE:
/*
$xml -> removeItem(1);
*/
?>