$sth->execute(); $sth->bind_columns(\my $max); $sth->fetch; # $max holds the value here