PHP
  Home arrow PHP arrow Introduction to Using SQLite with PHP ...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Introduction to Using SQLite with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 12
    2006-12-04

    Table of Contents:
  • Introduction to Using SQLite with PHP 5
  • The basics of SQLite
  • Retrieving rows from a database table
  • Examining a few more row-fetching methods

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introduction to Using SQLite with PHP 5


    (Page 1 of 4 )

    If you use PHP 5 to build web-based applications that access a database, you might want to consider SQLite. A "lighter" option than MySQL, this database may still suit your purposes if you don't need all of MySQL's bells and whistles. This three-part series covers many of SQLite's most useful features.

    Introduction

    On today's Web it is quite common to find websites that use some kind of database as an appropriate backend for housing their dynamic content. This content will be served to disparate site visitors by using either a procedural or an object-based application layer in conjunction with the corresponding presentation mechanism.

    Although the situation that I described above seems to grow increasingly common as the Web expands its apparently endless boundaries, I have to admit that this topic isn’t exactly the subject of this series. Instead, the question that I’d like to ask is the following: how many times during your life as PHP developer have you found yourself wishing to have at your disposal an RDBMS other than MySQL to fit your data storage requirements?

    Indeed, if you’re working on a particular web project that isn’t too demanding in terms of using a full-featured relational database system, the answer to the previous question should be "frequently." If the neatly-crafted PHP application that you’re currently developing needs to use an RDBMS, but doesn't require the utilization of the numerous, and sometimes overwhelming features offered by MySQL, I have good news for you.

    If you’ve been using PHP 5 for a while, maybe you’ve heard several comments about the cool RDBMS called “SQLite,” which comes embedded with the latest incarnation of the language. This feature is truly handy, since there’s no need to use a separate piece of software (like MySQL for instance) to build a database application.

    To be a little bit more specific concerning the topic, SQLite will let you perform most of the tasks you used to achieve with MySQL, like running buffered and unbuffered queries against a selected database, processing result sets in all sorts of clever ways, counting and seeking rows, and much more, by using only a group of intuitive methods (or functions, when using a procedural approach). Isn’t this great?

    Considering the numerous and handy features that come with the SQLite RDBMS, in this three-part series I’ll be introducing some of the most relevant ones. In this way you can start using them as part of your PHP 5-based applications.

    However, I’d like to clarify one more thing before diving into the subject: all the hands-on examples that you’ll learn here will use the object-based API included with this library. If you’re inclined to work with a procedural method, I suggest you take a look at the PHP manual to cover in detail this specific approach.

    With the preliminaries out of our way, it’s time to start discovering many of the useful methods that come bundled with SQLite. Let’s do it together!

    More PHP Articles
    More By Alejandro Gervasio


       · If you're using PHP 5 to develop your database-driven web applications, then you'll...
     

       

    PHP ARTICLES

    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter
    - Building Your Own System Tray Application Us...
    - Structuring Your Projects for Web Applicatio...
    - Inserting, Updating and Deleting Database Ro...
    - Building Your Own Desktop Notepad Applicatio...
    - Web Application Security Overview
    - Working with the Active Record Class in Code...
    - Generate PDF Documents with PHP on the Windo...
    - Sending Email with PHP Networking
    - Performing Strict Validation with the Code I...
    - The preg_replace_callback() function in PHP





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT