Changeset 51 for trunk/cgi-bin


Ignore:
Timestamp:
11/02/04 13:15:53 (20 years ago)
Author:
Kris Deugau
Message:

/trunk

Merge bugfixes and updates from /branches/stable r49 and r50

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r47 r51  
    253253    # Query for a customer ID.  Note that we can't restrict to "numeric-only"
    254254    # as we have non-numeric custIDs in the legacy data.  :/
    255     $sql = "select * from searchme where custid like '%$query%'";
     255    $sql = "select * from searchme where custid ilike '%$query%'";
    256256    my $count = countRows("select count(*) from ($sql) foo");
    257257    $sql .= " order by cidr limit $RESULTS_PER_PAGE offset $offset";
     
    262262    print qq(<div class="heading">Searching for descriptions containing '$query'</div><br>\n);
    263263    # Query based on description (includes "name" from old DB).
    264     $sql = "select * from searchme where description like '%$query%'";
     264    $sql = "select * from searchme where description ilike '%$query%'";
    265265    my $count = countRows("select count(*) from ($sql) foo");
    266266    $sql .= " order by cidr limit $RESULTS_PER_PAGE offset $offset";
     
    14821482
    14831483        # Set up query for compacting free blocks.
    1484         $sth = $ip_dbh->prepare("select * from freeblocks where city='$webvar{city}'".
     1484        $sth = $ip_dbh->prepare("select * from freeblocks where cidr << ".
     1485                "(select cidr from routed where cidr >> '$cidr') ".
    14851486                " and maskbits<=".$cidr->masklen." and routed='y' order by maskbits desc");
    14861487
     
    15281529      } else {
    15291530        $sth = $ip_dbh->prepare("insert into freeblocks values ('$cidr',".$cidr->masklen.
    1530                 ",'$webvar{city}','y')");
     1531                ",(select city from routed where cidr >>= '$cidr'),'y')");
    15311532      }
    15321533      $sth->execute;
Note: See TracChangeset for help on using the changeset viewer.