Selasa, 02 Juni 2015

Tutorial PHP SQLite

The SQLite3 extension is enabled by default as of PHP 5.3.0. It's possible to disable it by using --without-sqlite3 at compile time. Windows users must enable php_sqlite3.dll in order to use this extension. This DLL is included with Windows distributions of PHP as of PHP 5.3.0. aFor detailed installation instructions, kindly check our PHP tutorial and its official website.

Connection to Databases.
Following PHP code shows how to connect to an existing database. If database does not exist, then it will be created and finally a database object will be returned.

<?php
class MyDB extends SQLite3
{
function __construct()
{
$this‐>open('test.db');
}
}
$db = new MyDB();
if(!$db){
echo $db‐>lastErrorMsg();
} else {
echo "Opened database successfully\n";
}
?>
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 komentar

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© 2011 Micro Aisle
Designed by Didik Maryono
Posts RSSComments RSS
Back to top