PHP Classes

File: changes_example.php

Recommend this page to a friend!
  Classes of Josť Augusto Ferreira Franco  >  SQLite DB Handler  >  changes_example.php  >  Download  
File: changes_example.php
Role: Example script
Content type: text/plain
Description: This file generalizes class last changes, with some short pratical examples
Class: SQLite DB Handler
Create and manage SQLite database files
Author: By
Last change: added some features to the example
Date: 10 years ago
Size: 1,342 bytes


Class file image Download
require "sqlite_class.php";

//////////////////// LAST CHANGES ///////////////////////

#Two new methods added (28-12-2005 Wednesday 04:22)
#The method Select defines some sql clausules to do a select to database using SQLITE
#Method GetData allows to get an array of data values according the requested query and affected rows

# Author : Guto Ferreira (real name Josť Franco)

#$user = $_GET['user']; //// use this to get values from another page

$user = "Guto Ferreira";

$db = new db;
$conn = $db->Database("forum.txt");

$values = array("RESOURCE" => $conn,
"QUERY" => 1,
"ROWS" => "nome, login, password",
"TABLE" => "membros_auth",
"AFFECT" => "nome",
"CURRENT" => $user,
"ORDER" => "login");
$select = $db->Select($values);

$query = $db->Exec_Query($select);

while($rows = sqlite_fetch_array($query,SQLITE_ASSOC)){
$nome = $rows["nome"]."<br>";
$login = $rows["login"]."<br>";
$password = $rows["password"]."<br>";
echo $nome.$login.$password;

$rows = $db->GetData($query,array("nome","login","password"));
$rows as $data){

/// or u can use

echo $rows[0]."<br>".$rows[1]."<br>".$rows[2];