hello this is my code :
<?
$DBNAME='astbase.db';
$MYTABLE ='extens';
$wsdl = "wwwwww";
$reply = "wwww";
$idsms = "4";
$exten = 100;
$base= new PDO('sqlite:'.$DBNAME);//, 0666, $err);
$query = "CREATE TABLE IF NOT EXISTS $MYTABLE(id INTEGER PRIMARY KEY,exten VARCHAR(255), wsdl TEXT, reply text, idsms INTEGER)";
$results = $base->exec($query);
print_r($results);
$query = "INSERT INTO $MYTABLE(id,exten,wsdl,reply,idsms) VALUES(NULL,'$exten','$wsdl','$reply',$idsms)";
$results = $base->exec($query);
print_r($results);
?>
when i execute the script in the command line (php5 script.php), it works fine , but when i run it with the web browser, only the first statement is executed !!! what’s wrong ??
thanks
You should
sqlite_last_error()function just after your first statement (manual)I’m guessing it is a permissions issue, i.e. your webserver does not have the right to write in the directory where your sqlite database file is located.
It works with the command line because it uses your own user’s rights (whereas in the browser it uses Apache’s user, which often has less rights).