I have an SQLite database and am trying to connect to it with PHP. This is what I'm using:
<?php
$dbconn = sqlite_open('combadd.sqlite');
if ($dbconn) {
$result = sqlite_query($dbconn, "SELECT * FROM combo_calcs WHERE options='easy'");
var_dump(sqlite_fetch_array($result, SQLITE_ASSOC));
} else {
print "Connection to database failed!\n";
}
?>
However, I get this error:
Warning:
sqlite_open()
[function.sqlite-open]: file is encrypted or is not a database inC:\xampp\htdocs\deepthi\combadd\combadd_db.php
on line 4
Connection to database failed!
What's wrong and how can I fix it?