Re: Transfer query result to another script
| From: | C.R.Vegelin | Date: | Fri, 02 Nov 2007 16:25:23 +0000 |
| Subject: | Re: Transfer query result to another script | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263981@lists.php.net to get a copy of this message | ||
----- Original Message ----- From: "Jochem Maas" <jochem@iamjochem.com>
To: "C.R.Vegelin" <cr.vegelin@hetnet.nl>
Cc: "David Giragosian" <dgiragosian@gmail.com>; "php-general" <php-general@lists.php.net>
Sent: Friday, November 02, 2007 10:41 AM
Subject: Re: [PHP] Transfer query result to another script
C.R.Vegelin wrote: ...Hi Jochem, Engine.php does the following: a. checking validity of form query fields b. sending messages if invalid form query fields c. building the sql and executing it d. new: building $_SESSION['data'] for Report.php e. include / redirect for different output formats Step d. now passes the result set to Report.php. So Engine.php now redirects to Report.php once per query, and when the user changes report settings, Report.php is called by itself with required settings. More or less comparable to http://www.tonymarston.net/sample/person_list.php, except that my application is read-only and provided with graphs. I have to admit that I haven't tested the time needed for steps a-c. So I may save some time at the cost of extra mem to pass SESSION['data']. On the other hand, by splitting Engine and Report code I may save some mem, I think. Thanks for your time, Jochem. Regards, CorHi Jochem, The reason for a redirect is that Report.php has functionality such as sorting on report columns, checkboxes to make graphs etc. Suppose the following report columns: Country 06.Q1 06.Q2 06.Q3 06.Q4 07.Q1 07.Q2using a redirect doesn't solve the 'problem' - what does Engine.php doe exactly? how long does it take? your going to have think about caching the dataset generated by Engine in some way ... and sticking a MySQL resultset resource id in $_SESSION is not going to work. also does calling the script 'Report.php' mean you no longer have to refresh the page if you want to use different parameters? or do you still have to do a page refresh??1 Austria 1226 1211 1233 1328 1386 1362 2 Belgium 1004 1193 1008 9737 1102 12703 etc. If I don't use a redirect but an include Report.php then Engine.php must be rerun: - every time a user wants to sort on a columns, eg. Y06.Q1 - every time a user wants to make a graph with selected rows. Right ? I did use an include but I'm changing it because of the reasons above.I know it does have its price. Regards, Cor