hehe, okeli, let me try to explain in other words... the problem really isn't that difficult, but maybe hard to explain; you would know in a second if you could do a search in my database.
to be more detailed: it's for a big german simpsons-site. i use the database to store the data for each simpsons-episode, like the episode title, written by etc. i also have this screenshot field. it's a textarea with links to screenshots:
Code:
<A HREF="../screenshots/1/1f02_homer_runs.jpg">Homer runs away</A><BR>
<A HREF="../screenshots/1/1f02_smithersandburns.jpg">Smithers talks to Mr Burns</A><BR>
for each episode i have a different number of screenshots.
with the normal html.pl everything works just fine. i search for something and everything is on the right place when i view the database.
now i have a section where only the screenshots should be searchable. so i copied the html.pl plus .cfg and renamed them to screenshots.pl and screenshots.cfg. i can login with db.cgi?db=screenshots, no error.
when i click "View" and search in the screenshot field, i used the standard
$rec{'Screenshot'} for output.
with the example-code given above, a search for "Homer" would display:
Homer runs away
Smithers talks to Mr Burns this is because it searches field by field, not line by line - and prints far too many records. this is how i get 10 pages full of links, most of them wrong.
so i asked for a function that searches line-by-line, and the @lines does exactly what it should: i only get
Homer runs away the problem with this code occurs when the hits are displayed on more than one page. for example i get 10 pages as a search result, and only 2 of them contain data.
i think that this database works like this:
1. search the database
2. count the hits
3. generate the page based on the number of hits/page
4. send the page to the user
the @lines screws the display up, because it deletes the lines
after the hits are counted and the display is generated, so it's
3b. or something. this bug only occurs when the number of hits
without the @lines operation would be on more than one page.
what would maybe fix the bug is to implement the @lines command
before the pages are generated. the @lines should be number
1b..
mhm, are things clearer now? i hope so - and sorry it turned out so long