Diff for /db/prgsrc/db.cgi between versions 1.11 and 1.12

version 1.11, 2000/10/24 17:59:25 version 1.12, 2000/10/24 18:03:49
Line 465  sub GetQNum { Line 465  sub GetQNum {
         $sth->execute;          $sth->execute;
         return ($sth->fetchrow)[0];          return ($sth->fetchrow)[0];
 }  }
   sub GetMaxQId {
           my ($dbh) = @_;
           my ($sth) = $dbh->prepare("SELECT MAX(QuestionId) FROM Questions");
           $sth->execute;
           return ($sth->fetchrow)[0];
   }
   
 # Returns Id's of 12 random questions  # Returns Id's of 12 random questions
 sub Get12Random {  sub Get12Random {
    my ($dbh, $type, $num) = @_;     my ($dbh, $type, $num) = @_;
         my ($i, @questions, $q, $t, $sth);          my ($i, @questions, $q, $t, $sth);
         my ($qnum) = &GetQNum($dbh);          my ($qnum) = &GetMaxQId($dbh);
         my (%chosen);          my (%chosen);
         srand;          srand;
                   

Removed from v.1.11  
changed lines
  Added in v.1.12


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>