in reply to Re: Table in SQLite
in thread Table in SQLite

before this I was using MySQL, the database was kept in c:/MySQL/Data/ but in my script it like this

$dbh= DBI->connect("dbi:$dbtype:$dbname_ss;$dbip", "$dbuser", "$dbpass");


my $dbname_ss = "nehnu";
my $dbname_base_app = "hrms_base_ranhil";
my $dbip = "localhost";
my $dbuser = "root";
my $dbpass = "";
my $dbtype = "mysql";

So when I change to DBD::SQLite I change it but, it didn't work. I don't know how the last time I use MySQL it refer to c:/MySQL/Data/databasename but it work...

Replies are listed 'Best First'.
Re^3: Table in SQLite
by iburrell (Chaplain) on Jul 16, 2004 at 18:13 UTC
    The difference is that MySQL runs as a server and accesses a directory to store its database, and SQLite is library that reads a single file.

    DBD::mysql connects to the server (localhost), chooses a database (nehnu), which is mapped to a disk location (c:/MySQL/Data/database), and logs in with a user (root). The DSN contains all that info:

    DBI->connect("dbi:mysql:nehnu;localhost", "root", "");

    DBD::SQLite opens the database file. The DSN just needs the filename:

    DBI->connect("dbi:SQLite:/SQLite/Data/database.sqlt");