I've got a website I'm developping with PHP5 + SQLite3, It worls like a charm on WAMP on my computer, but for some reason it doesn't work on my Debian Server, I don't get any error, I can access my db via adminer.php, but my own PHP code doesn't seem to be able to access it.
Here are the 2 last lines of the error log :
[Fri Jun 20 01:33:37 2014] [error] [client 93.2.64.89] PHP Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: morceaux in /home/sim/www/gaec/sqlite-read.php on line 12
[Fri Jun 20 01:33:37 2014] [error] [client 93.2.64.89] PHP Fatal error: Call to a member function fetchArray() on a non-object in /home/sim/www/gaec/sqlite-read.php on line 14
And here is my DB-test php file :
<?php
$dbname='viandes.db3';
$mytable ="morceaux";
if(!class_exists('SQLite3'))
die("SQLite 3 NOT supported.");
$base=new SQLite3($dbname, 0666);
$query = "SELECT DISTINCT Animal FROM $mytable WHERE LENGTH(Animal)>0";
$results = $base->query($query);
while ($row = $results->fetchArray())
{
if(count($row)>0)
{
$title = $row['Animal'];
echo "</br> $title </br>";
}
else
{
echo "Can't access $mytable table.";
}
}
?>