Results 1 to 5 of 5

Thread: SQLite 3 PHP

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Eclipse Plugin Developer aphex's Avatar
    Join Date: Mar:2003
    Location: Karlsruhe
    Posts: 546

    SQLite 3 PHP

    SQLite 3 PHP 5.2.4 ... SQLite 2 , 3 . ??
    We are drowning in information, but starving for knowledge and time!

  2. #2
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    " SQLite 3 PHP 5.2.4". ? ? , ? , ? , ? .., .... , .
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  3. #3
    Eclipse Plugin Developer aphex's Avatar
    Join Date: Mar:2003
    Location: Karlsruhe
    Posts: 546
    XAPP .
    . SQLite3.dll php.ini php5.ini. phpinfo() , "could not find driver"

    :
    Code:
    <?php
    
    // create a SQLite3 database file with PDO and return a database handle (Object Oriented)
    try{
    
    $dbHandle = new PDO('sqlite:'.$_SERVER['DOCUMENT_ROOT'].'/../pdoTutorial.sqlite3');
    
    }catch( PDOException $exception ){
    
    die($exception->getMessage());
    
    }
    
    // create page view database table
    $sqlCreateTable = 'CREATE TABLE pageView(id INTEGER PRIMARY KEY AUTOINCREMENT, page CHAR(256), access INTEGER(10))';
    $dbHandle->exec($sqlCreateTable); // remove or 'comment out' this line after first run
    
    // insert page visit in database with a prepared statement
    $sqlInsertVisit = 'INSERT INTO pageView (page, access) VALUES (:page, :access)';
    
    $stmt = $dbHandle->prepare($sqlInsertVisit);
    $stmt->bindParam(':page', $_SERVER['PHP_SELF'], PDO::PARAM_STR);
    $stmt->bindParam(':access', time(), PDO::PARAM_INT);
    $stmt->execute();
    
    // get page views from database
    $pageVisit = $dbHandle->quote($_SERVER['PHP_SELF']);
    $sqlGetView = 'SELECT count(page) AS view FROM pageView WHERE page = '.$pageVisit.'';
    $result = $dbHandle->query($sqlGetView);
    $pageView = $result->fetch(); // store result in array
    
    // print page views
    echo 'This page has been viewed '.$pageView['view'].' times.';
    
    ?>
    phpinfo

    PDO drivers mssql, mysql, sqlite2

    SQLite support enabled
    PECL Module version 2.0-dev $Id: sqlite.c,v 1.166.2.13.2.10 2007/12/31 07:20:11 sebastian Exp $
    SQLite Library 2.8.17
    SQLite Encoding iso8859
    We are drowning in information, but starving for knowledge and time!

  4. #4
    relative dude Skydive's Avatar
    Join Date: Nov:2002
    Location: /
    Posts: 2,863
    .

  5. #5
    Eclipse Plugin Developer aphex's Avatar
    Join Date: Mar:2003
    Location: Karlsruhe
    Posts: 546
    , Skydrive, "could not find driver"
    We are drowning in information, but starving for knowledge and time!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |