Login   Register  
PHP Classes
elePHPant
Icontem

File: changes_example.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  >  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: 2005-12-27 20:49
Size: 1,342 bytes
 

Contents

Class file image Download
<?php
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"));
 foreach(
$rows as $data){
 echo 
$data;
 }

/// or u can use 

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


$db->Close();

?>