On 6/20/07, Aruna Goke <[EMAIL PROTECTED]> wrote:
snip
$dbh = DBI->connect($data_source, $user, $pass);
snip

change this line to

$dbh = DBI->connect(
   $data_source,
   $user,
   $pass
   {
       RaiseError => 1
   }
);

And the code will raise an error telling you what is wrong with the
SQL.  Also, don't do declare all of your variables at once.  Declare
them as they are needed, that way you will get an error if you try to
use them before they are initialized.

do this instead

my $data_source='dbi:mysql:radonet:localhost';
my $user='root';
my $pass='junkh1a';
my $database='radius';
my $hostname='localhost';
my $port='3306';
my $dbh = DBI->connect($data_source, $user, $pass);
my $sql = "UPDATE radacct SET AcctSessionTime = ?, TrunkIdOut = ?,
TrunkIdIn = ? where AcctUniqueId = ?";

Also also, don't store all of this information in your script.  Put it
in a config file.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to