Hi Sean,

I do already have some of the books that you mention, and I have just recently picked up the perl medic to help convert these scripts to the latest version of perl.

However, as I already use hidden fields and have started working on script generated forms, pattern matching, mysql to mention a few things, (although I did see some other things in a book I was flicking through last night that will lead to some other questions here, like using tk toolkit on the web, perl embed, perl sessions etc) I have already altered these script so far that I doubt that copyright exists on them anymore.

I just don't understand the concept of what happens when a script tries to create multiple pages from one query. This makes it difficult to create the code. If you say perl DBI then I already have a book on its way, and I will just have to wait for it to come in.

Thank for your assistance

Cat
----- Original Message ----- From: "Sean Davis" <[EMAIL PROTECTED]>
To: "Literatecat" <[EMAIL PROTECTED]>
Cc: <beginners-cgi@perl.org>
Sent: Wednesday, January 05, 2005 12:40 PM
Subject: Re: Database Rows Returned



In order to do this, you will need to have some way of determining where you are in the count of pages, number of rows, etc., so you will need to store some stuff in hidden fields on your page (or in the query string). Also, based on those values, you will need to generate a page and make a way to move from one page to the next. This is a tedious process, but it isn't difficult. However, you don't necessarily need to reinvent the wheel. If you incorporate a data model into your design, like Class::DBI, you can take advantage of some of their extension modules, like Class::DBI::Pager. Unfortunately, any solution here will require learning a fair amount about how your existing code works and how to generate CGI forms. Again, none of this is hard, but I would suggest getting a CGI book if all of the above terminology (like hidden fields) sounds foreign.

Sean

----- Original Message ----- From: "Literatecat" <[EMAIL PROTECTED]>
To: "Sean Davis" <[EMAIL PROTECTED]>
Cc: <beginners-cgi@perl.org>
Sent: Tuesday, January 04, 2005 7:29 PM
Subject: Re: Database Rows Returned



Hi Sean,

The max_rows_returned is set in the setup file, but it simply determines the number of rows per page. Then when it reads line by line that there are more than the predetermined maximum rows per page, it prints the warning that the number of rows have been exceeded, and suggests refining the search parameters.

In this case, could refining search parameters be as simple as setting a limit in the SQL query?


Problem is that I want to be able to pick up all the rows although not all on the same page, there must be some way of getting it to change to creating a new page with the next line read exceeding the max rows, and so on till the search parameter is filled. Then placing the link to the next set of "25" for instance at the bottom of the page instead of suggested that the search be refined.

Unfortunately, CGI scripts cannot make decisions like "make a new page". Their only job is to generate ONE HTML page based on input from the request. At each page generation, you have to provide enough information on the page so that the next request (based on a submit button click, for example) allows the script to generate the next page when it runs again (eg., you have to tell the script what page number in a multiple-page output to generate; you can do this with form parameters).


You can see this in operation at http://www.etheria.com.au/cgi-bin/web_store.pl?





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to