Login   Register  
PHP Classes
elePHPant
Icontem

File: accesstest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Harish Chauhan  >  Har DB Classes  >  accesstest.php  >  Download  
File: accesstest.php
Role: Example script
Content type: text/plain
Description: Example File
Class: Har DB Classes
Database access abstraction for MS Access and ODBC
Author: By
Last change:
Date: 9 years ago
Size: 622 bytes
 

Contents

Class file image Download
<?php

    
include_once("msaccessdb_win.inc.php");
    
//include_once("odbcdb.inc.php");

    
$db=new DB;
    
$db->open();
    
$sql="INSERT INTO test (name,age) VALUES('Harish',22)";
    
//$sql="UPDATE test SET name='sriram1' WHERE name='sriram'";
    //$sql="DELETE FROM test WHERE id >=20";
    
$db->query($sql);
    echo 
$db->error();
    echo 
$db->affectedRows();
    echo 
"<br>";
    
//echo  $db->insertID();

    
    
$sql 'Select id,name,age FROM test';
    
$db->query($sql);
    
//echo $db->error();
    
echo $db->numRows();
    echo 
"<br>";
    while(
$row=$db->fetchObject())
    {
        
print_r($row->name);
        echo 
"<br>";
    }
    
$db->close();
    
?>