Database Articles

  Home arrow Database Articles arrow Page 5 - PEAR::SQLite: The Lightweight Alternat...
DATABASE ARTICLES

PEAR::SQLite: The Lightweight Alternative
By: bluephoenix
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2004-02-22

    Table of Contents:
  • PEAR::SQLite: The Lightweight Alternative
  • Installing PEAR::SQLite
  • Connecting to a Database
  • Queries
  • Composite Code
  • Unsupported SQL Commands

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    PEAR::SQLite: The Lightweight Alternative - Composite Code


    (Page 5 of 6 )

    Here's our example code composited to show a sample PHP script using PEAR::SQLite:

    <?php
    require_once "DB.php";
    require_once 
    "DB/sqlite.php";

    $db = new DB_sqlite();

    $DSN = array("database" =&gtgetcwd() . "/dbase/mydbase.db");

    $db-&gt;connect($DSN);

    $query "SELECT * FROM guestbook";

    $result $db-&gt;query($query);

    while (list(
    $fname$lname$email$comment) = $db-&gt;fetchRow($result))
    {
       echo 
    "&lt;p&gt;&lt;a href=\"mailto:$email\"&gt;$fname $lname&lt;/a&gt; said:&lt;br /&gt;";
       echo 
    nl2br(htmlspecialchars(stripslashes($comment))) . "&lt;/p&gt;";
    }

    $db-&gt;disconnect();
    ?>

    More Database Articles Articles
    More By bluephoenix

    blog comments powered by Disqus

    DATABASE ARTICLES ARTICLES

    - Completing a Book Inventory Management System
    - Uploading Images for a Book Inventory Manage...
    - Finishing the Add Book Story for a Book Inve...
    - Integration Testing for a Book Inventory Man...
    - User Stories for a Book Inventory Management...
    - Unit Testing a Book Inventory Management Sys...
    - Testing a Book Inventory Management System
    - Implementing Models for a Book Inventory Man...
    - Book Inventory Application: Publishers and B...
    - Handling Publishers in a Book Inventory Mana...
    - Publisher Administration for Book Inventory ...
    - Book Inventory Management
    - Using the SQL Reference Manual
    - Using Oracle SQL Developer with SQL Statemen...
    - Fixing Errors with Oracle SQL Developer


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap