Hi guys, odd problem for you to mull over!
I’m writing an agi script to manager the booking of conference calls, the data is stored in an SQLite database and is being access via odbc (since im using it for realtime also), i’ve written te bulk of the script and it reads from the database perfectly however the script is unable to carry out any operations to change the database, i’ve made a basic test script and if i run the script from the command line it works without issue however if i run it as an agi i get an error updating the database
[code]#!/usr/bin/perl
use DBI;
print “VERBOSE “”. %ENV->{‘USER’}.”"\n";
my $dbh = DBI->connect(“dbi:ODBC:bookings”, “”, “”,{ AutoCommit => 1});
my $sth = $dbh->prepare(“update bookings set userpin
= ? where chan
=?”);
$sth->execute(“9999”,“4”);
print “VERBOSE “Le Error!: “.$dbh->errstr.”””;
[/code]
When i run this through asterisk as an agi script i get
However when run directly with perl it does it’s job and exits cleanly, i’ve checked permissions, i’ve even set the permissions on the SQLite database file to 777 and no joy.
Help!