Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 692179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:37:27+00:00 2026-05-14T02:37:27+00:00

What is the difference between: $db = new SQLiteDatabase(‘name.db’); and $db = new PDO(‘sqlite:name.db’);

  • 0

What is the difference between:

$db = new SQLiteDatabase('name.db');

and

$db = new PDO('sqlite:name.db');

Since, I don’t understand the big picture here, details are premature for me and the information available online appears to assume certain knowledge I seem to be lacking. Please don’t just paste in links to the PHP manual. Less specific, more general concepts will be useful for me.

Also, do both of these approaches use SQLite 3, as opposed to SQLite 2?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:37:27+00:00Added an answer on May 14, 2026 at 2:37 am

    Directly using the SQLite functions/classes, your PHP code will only be compatible with SQLIte.

    Using PDO, your PHP code will be compatible with many database systems — see PDO Drivers for a list of existing drivers.

    Quoting the Introduction page of PDO :

    PDO provides a data-access abstraction
    layer, which means that, regardless of
    which database you’re using, you use
    the same functions to issue queries
    and fetch data.

    This abstraction layer can be useful if you want your code to be compatible with more than one DB engine ; but note that :

    • Using PDO, you cannot always use features that are specific to a database system
    • Using PDO means your PHP code will be compatible ; it doesn’t mean your SQL will be too : that’s still your job.

    For the question about SQLite and SQLite3 :

    • PDO seems to support both — see SQLite Functions (PDO_SQLITE)
      • To use one or the other, you should just have to use a different DSN.
      • Note : working with several distinct DB systems is the kind of thing for which PDO is great 😉
    • Using the specific DB extensions :
      • There is one extension for SQLite2 : SQLite
      • And one other extension for SQLite3 : SQLite3
        • Note that this one seems to only be included with PHP >= 5.3
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the difference between new / delete and malloc / free ? Related
What is the difference between using a new thread and using a thread from
What is the difference between old style and new style classes in Python? When
What is the difference between this: this.btnOk.Click += new System.EventHandler(this.btnOK_Click); and this? this.btnOk.Click +=
I was just wondering if there is any difference between the two different new
What is difference between new operator and operator new?
How do you determine the difference between new Object and new fn under these
Possible Duplicates: What is the difference between new/delete and malloc/free? In what cases do
maybe it's dumb but is there a difference between new Something().method(); and Something tmpSomething
What is the difference between early and late binding?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.