connect('DBI:mysql:sps:localhost', 'spsdb_user','', { PrintError => 0}) || die $DBI::errstr; my @membertypes = ("22", "23", "24"); # 22 is Platinum, 23 is Gold, 24 is Silver # foreach my $elem (@membertypes) { # my $SQL = "SELECT member_type from member_type where membertype_id = \"".$elem."\""; # my $cursor = $dbh->prepare($SQL); # $cursor->execute; # my @fields; # @fields = $cursor->fetchrow; # my $color; # SWITCH: { # if ($elem eq "22") { $color = "#999999"; } # if ($elem eq "23") { $color = "#cccc00"; } # if ($elem eq "24") { $color = "#cccccc"; } # my $nothing = 1; # } my $buffer; # my $buffer = "

$fields[0]

"; # my $SQL2 = "SELECT lname, fname, mail_city, mail_state, url from member where member = \"1\" and membertype_id = \"$elem\" order by mail_state"; my $SQL2 = "SELECT lname, fname, mail_city, mail_state, url from member where member = \"1\" and membertype_id in (22,23,24) order by mail_state"; my $cursor2 = $dbh->prepare($SQL2); $cursor2->execute; my @fields2; while (@fields2 = $cursor2->fetchrow) { $buffer .= "

"; # if ($elem != "24" and $fields2[4]) { if ($fields2[4]) { if (!($fields2[4] =~ /^http/)) { $fields2[4] =~ s/^/http\:\/\//; } $buffer .= "$fields2[0] $fields2[1]"; } else { $buffer .= "$fields2[0] $fields2[1]"; } $buffer .= "
"; $buffer .= "$fields2[2], $fields2[3]


"; } $cursor2->finish; # $cursor->finish; # print $buffer . "
"; print $buffer; #} !>