PHP Classes

File: index.php

Recommend this page to a friend!
  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: 20 years ago
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);
    }
  }
?>