Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Waqas Ahmed  >  SQLite and MySQL  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: SQLite test script
Class: SQLite and MySQL
Access MySQL and SQLite databases
Author: By
Last change:
Date: 2010-08-24 10:40
Size: 619 bytes
 

Contents

Class file image Download
<?php 

require_once 'SQLite.php';
$sql "SELECT * FROM foo";

try {
    
    
$connection = new SQLite("Book Store""BookStore.sqlite");
    
    if (
$connection->IsOpen()) {
        
        
$resultSet $connection->Execute($sql);
        
    } else {
        
        echo 
'Cannot Perform the Task!';
        
    }
    
    
$content null;
    
    if (
$resultSet!=NULL) {
        
        while (
$resultSet->MoveNext()) {
            
            
$content .= $resultSet->Field(0) . "    " $resultSet->Field(1) . '<br>';
    
        }
        
    } else {
        
        echo 
'No Data in the Query!';
        
    }
    
    echo 
$content;
    
} catch (
Exception $e) {
    
    
$e->getTraceAsString();
    
}


?>