=100"; $term = ' AND '; } $query = $query . " ORDER BY confidence"; $result = pg_query($query) or die('Query failed: ' . pg_last_error()); $start = @$_GET['start']; if (pg_num_rows($result) == 0) die('nothing found'); if ($count > pg_num_rows($result)) $count = pg_num_rows($result); if ($start == '') $start = pg_num_rows($result) - $count; printf("