PHP Classes
elePHPant
Icontem

File: example.db.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Venkatesh balakumar  >  DB Connect with XML  >  example.db.php  >  Download  
File: example.db.php
Role: Example script
Content type: text/plain
Description: Example Usage Code
Class: DB Connect with XML
Generate XML documents MySQL query results
Author: By
Last change:
Date: 6 years ago
Size: 1,861 bytes
 

Contents

Class file image Download
<?php
     
include 'db.php';
    class
UserManagement {
        function
getuserlist() {
           
$ddb = new database();
           
$query = "Select a.user_id, a.person_id, a.user_group_id, a.user_name, a.pass_word, a.loginmessage_id, a.start_date, a.end_date, a.created_on, a.created_by, a.modified_on, a.modified_by,";
       
$query = $query . " b.salutation, b.first_nm, b.last_nm, b.created_on as person_created_on, b.created_by as person_created_by, b.modified_on as person_modified_on, b.modified_by as person_modified_by,";
       
$query = $query . " c.user_group_desc";
       
$query = $query . " from pa_user a";
       
$query = $query . " join (pa_person b, pa_user_group c)";
       
$query = $query . " on (a.user_group_id = c.user_group_id";
       
$query = $query . " and a.person_id = b.person_id)";
           
$result = $ddb->select($query);
           
$xml = $ddb->data_to_xml($result);
           
mysql_free_result($result);
            return
$xml;
        }
       
        function
getuser($uid) {
           
$ddb = new database();
           
$query = "Select a.user_id, a.person_id, a.user_group_id, a.user_name, a.pass_word, a.loginmessage_id, a.start_date, a.end_date, a.created_on, a.created_by, a.modified_on, a.modified_by,";
       
$query = $query . " b.salutation, b.first_nm, b.last_nm, b.created_on as person_created_on, b.created_by as person_created_by, b.modified_on as person_modified_on, b.modified_by as person_modified_by,";
       
$query = $query . " c.user_group_desc";
       
$query = $query . " from pa_user a";
       
$query = $query . " join (pa_person b, pa_user_group c)";
       
$query = $query . " on (a.user_group_id = c.user_group_id";
       
$query = $query . " and a.person_id = b.person_id)";
       
$query = $query . " Where a.user_id = " . $uid;
           
$result = $ddb->select($query);
           
$xml = $ddb->data_to_xml($result);
           
mysql_free_result($result);
            return
$xml;
        }
}
?>