Hi everyone,
Can anyone please tell me what the problem is with this code?
Every time I run my program with this code in it, I get an error in the log
files:
DBD::mysql::st fetchrow_array failed: fetch() without execute() at
IWeb/sqlengine.pm line 3395.
sub SQL_Is_Sponsor {
my ($link_id) = @_;
my $is_sponsor = 0;
if($link_id) {
my $PriviledgeGroupID;
$SQL = "SELECT account FROM HS_links WHERE id = $link_id";
$sth = $dbh->prepare($SQL) || IWEB::SQL_ERROR($SQL);
$rc = $sth->execute || IWEB::SQL_ERROR($SQL);
my($account) = $sth->fetchrow_array;
if($account) {
$SQL = "SELECT PriviledgeGroupID FROM USERU WHERE UserName =
'$account'";
$sth = $dbh_bac->prepare($SQL) || IWEB::SQL_ERROR($SQL);
$PriviledgeGroupID = $sth->fetchrow_array;
}
foreach my $level(split(/:/, $global{'yh_sponsor_levels'})) {
if($PriviledgeGroupID == $level) {
$is_sponsor = 1;
}
}
return($is_sponsor);
}
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]