Changeset 96 for trunk


Ignore:
Timestamp:
12/01/04 15:53:28 (20 years ago)
Author:
Kris Deugau
Message:

/trunk

Added city and POP list initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r95 r96  
    3434our %disp_alloctypes;
    3535our %list_alloctypes;
     36our @citylist;
     37our @poplist;
    3638
    3739# Let's initialize the globals.
     
    4244  my $sth;
    4345
     46  # Initialize alloctypes list
    4447  $sth = $dbh->prepare("select type,dispname from alloctypes");
    4548  $sth->execute;
    4649  return (undef,$sth->errstr) if $sth->err;
    47 
    4850  while (my @data = $sth->fetchrow_array) {
    4951    $disp_alloctypes{$data[0]} = $data[1];
    5052  }
     53
     54  # City and POP listings
     55  $sth = $dbh->prepare("select * from cities");
     56  $sth->execute;
     57  return (undef,$sth->errstr) if $sth->err;
     58  my $i = 0;
     59  my $j = 0;
     60  while (my @data = $sth->fetchrow_array) {
     61    $citylist[$i++] = $data[0];
     62    if ($data[1] eq 'y') {
     63      $poplist[$j++] = $data[0];
     64    }
     65  }
     66
    5167  return (1,"OK");
    5268} # end initIPDBGlobals
Note: See TracChangeset for help on using the changeset viewer.