This topic is locked
[SOLVED]

 PHPR 5.2 b 4002 sqlite database configuration

12/22/2009 5:36:24 PM
PHPRunner General questions
C
cgetty author

I ran a existing project from phprunner 5.1.
I changed the database from Mysql to Sqlite.

In Phprunner on the local PC I just point to the database path which is in my root docs folder, works ok.
How do I configure it to run on the hosted system ?
As I recall using Mysql I edited the dbcommon.php to set the path for the data source.
how should it be done for sqlite?
Clark

J
Jane 12/23/2009

Clark,
connection strings for all databases are in the dbcommon.php file. Just edit this file on your web server.

C
cgetty author 12/23/2009



Clark,
connection strings for all databases are in the dbcommon.php file. Just edit this file on your web server.


Ok I did that, just not sure I did it right.
Here are the settings from my local PC for the dbcommon.php file.(works)

$dbname="C:\\xampp\\htdocs\\lite\\dbs.sqlite";

$ODBCString = "DRIVER={SQLite3 ODBC Driver};Database=C:\\xampp\\htdocs\\lite\\dbs.sqlite";
And here is what I changed them to for my hosted ISP.

$dbname="dbs.sqlite";

$ODBCString = "DRIVER={SQLite3 ODBCDriver};Database=dbs.sqlite";
And if by some stretch of the imagination the settings are right I also asked for help from my ISP.

http://www.zymic.com/forum/index.php?showtopic=21315

C
cgetty author 12/29/2009

Hi
I looked for a web host that would support an sqlite datadase. These folks at "Free Hostia" said no problem.
Then I asked them how I could configure the sqlite database. Then they sent me this link. http://cgetty.freehostia.com/1info.php
And this link http://cgetty.freehostia.com/1test.php and said your on your own <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=46516&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />
So I asked them to provide my with the sqlite test script so I could examine it to see how the connection was done, below is the test script.
<?php

if ($db = new SQLiteDatabase('filenametest.db')) {

$q = @$db->query('SELECT requests FROM tablename WHERE id = 1');

if ($q === false) {

$db->queryExec('CREATE TABLE tablename (id int, requests int, PRIMARY KEY (id)); INSERT INTO tablename VALUES (1,1)');

$hits = 1;

} else {

$result = $q->fetchSingle();

$hits = $result+1;

}

$db->queryExec("UPDATE tablename SET requests = '$hits' WHERE id = 1");

echo "<pre>" . $result . "</pre>";

} else {

die($err);

}

?>
I'm trying to do everything I can to figure this situation out. I'm new at php & phprunner. When I saw in the phprunner upgrade support for sqlite I was encouraged. Hopefully if this gets figured out others will benefit from this post.
In the mean time I'll look over the test script & do some experimenting.
Thanks

Clark

Admin 12/29/2009

Clark,
I guess the first question to ask your hosting company if they support SQLite3.

C
cgetty author 12/29/2009



Clark,
I guess the first question to ask your hosting company if they support SQLite3.


My host sent me this link http://cgetty.freehostia.com/1info.php
Among some other data it said the following.

pdo_sqlite

PDO Driver for SQLite 3.x enabled

PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.3 2007/12/31 07:20:10 sebastian Exp $

SQLite Library 3.3.7
In addition to the above info I reopened my ticket (with freehostia.com) on this subject and asked them outright "Do you support SQLite3"
This was their response.

Hello,
Yes, the SQLite library 3.3.7 is supported on our service as you can see in the info.php file: