script doesnt work included and works pointed directly?
Just imagine that, in a .php file if you use a folder or a related file its location to that file can change if you include it from an upper folder's php page. In your case a .db file is in the same level with the (included) php file,
but if you want to include it from another point that .db file then douesn't exists.
use a full path to that .db file from the WWWroot in the included program