Login   Register  
PHP Classes
elePHPant
Icontem

File: example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of José Augusto Ferreira Franco  >  SQLite DB Handler  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: This short example shows the process required to build a table with class db from package SQLITE DB HANDLER
Class: SQLite DB Handler
Create and manage SQLite database files
Author: By
Last change:
Date: 2005-12-18 19:14
Size: 1,149 bytes
 

Contents

Class file image Download
<?php
require_once("sqlite_class.php");


#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# Database and table process with class db from package "SQLITE DB HANDLER"
# Author : Guto Ferreira
# Web :    http://onidesk.sytes.net
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//{{{{ instanciates the class
$db = new db;
///}}}}}


// {{{ makes the  connection with seted database file
$db->database("database.txt");
//}}}}


//{{{  informing the array that will pass the values to generate table name and table rows and data type
$values = array("TABLE" => "novidades",   // on this line just alter the table name (on this example the table name is novidades)
                
"id"     => "INTEGER PRIMARY KEY",
                
"titulo" => "VARCHAR(40)",
                
"artigo" => "TEXT(100)",
                
"autor"  => "TEXT(16)",
                
"data"   => "NUMERIC(12)");
/// passing the values as a parameter to the method "Create_Table"
$db->Create_Table($values);

//}}}}


//{{{ Close the connection with database
$db->Close();




?>