Login   Register  
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 Diogo Resende  >  CSQLite  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example
Class: CSQLite
Wrapper to access SQLite databases under PHP 5
Author: By
Last change:
Date: 2004-05-10 09:01
Size: 487 bytes
 

Contents

Class file image Download
<?php
  
include "class.sqlite.php";
  
  
$sql = new CSQLite();
  if (
$sql->open(realpath('') . '/mysqlitedb'))
  {
    
$sql->query('CREATE TABLE foo (myfield varchar(10))');
    
$sql->query('INSERT INTO foo VALUES (\'bar\')');
    
$sql->query('INSERT INTO foo VALUES (\'bear\')');
    
$sql->query('SELECT * FROM foo ORDER BY myfield DESC');
    
    
header('Content-Type: text/plain');
    
    while (
$row $sql->fetch_row())
    {
      
print_r($row);
    }
  }
?>