Ive asked a couple times about a cron here, but those were all before we got the built-in perl modules. So, can anyone help me finish this?
Right now Im getting the error "syntax error at /home/oiwio/public_html/hpup2.pl line 14, near "use "/home/oiwio/perl/DBD::mysql""
Execution of /home/oiwio/public_html/hpup2.pl aborted due to compilation errors."
It is supposed to add 1 to all hp's every 15 minutes
Help would be much appreciated
Right now Im getting the error "syntax error at /home/oiwio/public_html/hpup2.pl line 14, near "use "/home/oiwio/perl/DBD::mysql""
Execution of /home/oiwio/public_html/hpup2.pl aborted due to compilation errors."
It is supposed to add 1 to all hp's every 15 minutes
Code:
#!/usr/bin/perl
# PERL MODULE WE WILL BE USING
my $homedir = (getpwuid($>))[7];
my $n_inc = scalar @INC;
for (my $i = 0; $i < $n_inc; $i++ ) {
if (-d $homedir . '/perl' . $INC[$i]) {
unshift(@INC,$homedir . '/perl' . $INC[$i]);
$n_inc++;
$i++;
}
}
use DBI;
print "Content-type: text/html \n\n";
# MySQL CONFIG VARIABLES
$host = "localhost";
$database = "oiwio_oiwio";
$tablename = "users";
$user = "oiwio_oiwio";
$pw = "Fishonfire88";
# PERL MYSQL CONNECT
$connect = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $pw, {RaiseError => 1});
$connect->selectdb($database);
SETVALUES ($hp) = $hp + 1;
$myquery = "INSERT INTO
$tablename (username, hp)
VALUES (*, $hp)";
$execute = $connect->query($myquery);
Help would be much appreciated
Last edited: