This is a fairly new install on a XP machine. Apache/2.2.11 (Win32) PHP/5.2.10.
I created a folder outside of my root called sqlite3 and granted myself 'all' privileges to it though the properties dialogue box.
To make sure (I think) that my problem is permissions, I copied the file I'm trying to access from the sqlite3 folder into my root, modified my script, and it runs.
Here's a copy of my script:
Code: Select all
<?php
// $db = 'db.sqlite';
// set path of database file
$db = $_SERVER['DOCUMENT_ROOT']."../../sqlite3/db.sqlite";
// open database file
$handle = sqlite_open($db) or die();
// generate query string
$query = "SELECT * FROM foo";
// execute query
$result = sqlite_query($handle, $query) or die($db . ' Error in query: ' . sqlite_error_string(sqlite_last_error($handle)));
// if rows exist
if (sqlite_num_rows($result) > 0) {
// get each row as an array
// print values
echo '<table cellpadding=10 border=1>';
while($row = sqlite_fetch_array($result)) {
echo '<tr>';
echo '<td>'.$row[0].'</td>';
echo '<td>'.$row[1].'</td>';
echo '</tr>';
}
echo '</table>';
}
// all done
// close database file
sqlite_close($handle);
?>
Code: Select all
Warning: sqlite_open() [function.sqlite-open]: unable to open database: C:\sqlite3\db.sqlite in C:\public_html\snippits\sqlite.php on line 12I think I have a permission problem on the server, but I don't understand why or how to correct it.
Can somebody help me out with this or point me in the right direction?
Thanks,
Paul