PHP Classes

File: access.php

Recommend this page to a friend!
  Classes of Sameer Pal Singh   MySQL Access Wrapper Class   access.php   Download  
File: access.php
Role: Example script
Content type: text/plain
Description: Example file for using database class
Class: MySQL Access Wrapper Class
MySQL database access wrapper
Author: By
Last change:
Date: 18 years ago
Size: 1,816 bytes
 

Contents

Class file image Download
<?php
/*
################################################################
Programmer Name : Sameer Pal Singh
Created On : 15-Apr-2006
Description : Example file for Accessing Database wrapper
Include Files : clsDb.php
Modified By : --
Modification Date : --
Reason of Modification : --
################################################################
*/
?>
<?php
require_once("clsDb.php");
?>
<?php
$db
= new db_driver;

//select data in table.
$db->simple_select('perm_key, perm_bit','ibf_admin_permission_keys','perm_main="tools"');
echo
$db->get_num_rows();

/*
while($db->fetch_row_object())
{
    echo $db->row->perm_key. "<br>";
    echo $db->row->perm_bit. "<br><br>";
}
*/

/*
while($db->fetch_row())
{
    echo $db->row[0]. "<br>";
    echo $db->row[1]. "<br><br>";
}
*/

/*
$tbl = 'ibf_topic_markers';
$arr = array();
$arr['marker_member_id'] = 16;
$arr['marker_forum_id'] = 17;
$db->do_insert( $tbl, $arr);
echo $db->get_insert_id(); //if above do_insert has not worked than this will return 0.
*/

/*
$tbl = 'ibf_topic_markers';
$db->simple_delete( $tbl, 'id=3' )
*/

/*
$tbl = 'ibf_topic_markers';
$arr =array('marker_member_id'=>'11', 'marker_forum_id'=>'22') ;
$db->do_update($tbl,$arr,"id=1");
echo "<br>".$db->get_affected_rows();
*/

/*
 Select with join
 $db->build_query( array( 'select' => 'd.*',
                            'from' => array( 'dnames_change' => 'd' ),
                            'where' => 'dname_member_id='.$id,
                            'add_join' => 0 => array( 'select' => 'm.members_display_name',
                                                      'from' => array( 'members' => 'm' ),
                                                      'where' => 'm.id=d.dname_member_id',
                                                      'type' => 'inner' ),
                            'order' => 'dname_date DESC' ) );
*/


?>