October 5th, 2008Data Services with SQLite in PHP
Yesterday I wrote a how-to on doing MSSQL DataService in PHP. It was just about installing necessary PDO drivers and setting the following configurations about your Database.
// database configurations $config = array( "db" => "mssql", "username" => DB_USERNAME "password" => DB_PASSWORD "dbname" => DB_NAME, "dbhost" => DB_SERVER_NAME );
But when it comes to SQLite you don’t have such thing called database server, name, username or password. It is just a file in your computer. In this kind of situation you can directly use the PDO DSN (standards for Data Source Name) string to configure your database.
// giving my sqlite database file information $config = array( "dsn" => "sqlite2:mydbfile.db");
So this is all specific to SQLite. For the rest of the code, you don’t need to worry about the underlying database you use. Please read the blog about the PHP DataServices 2 Minutes Introduction for short guide on PHP data services in general.
![[Ask]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/ask.png)
![[Bloglines]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/bloglines.png)
![[del.icio.us]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/digg.png)
![[diigo]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/diigo.png)
![[dzone]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/dzone.png)
![[Facebook]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/myspace.png)
![[MyWeb]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/myweb.png)
![[Newsvine]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/newsvine.png)
![[PlugIM]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/plugim.png)
![[Reddit]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/slashdot.png)
![[Spurl]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/spurl.png)
![[StumbleUpon]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Twitter]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/twitter.png)
![[Windows Live]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.dimuthu.org/wp-content/plugins/bookmarkify/email.png)
December 7th, 2008 at 12:58 pm
[...] with SQLite or MSSQL, You can check my other posts on MSSQL(Microsoft SQL) Data Services In PHP and Data Services with SQLite in PHP. Close Bookmark and Share This Page Save to Browser Favorites / [...]