Stuggling with the following:
Constructing a multi-part database search in MySQL e.g. Part 1 delivers IDs 4, 5, 6; Part 2 delivers 12, 1, 34, 8; Part 3 delivers 25, 10, 2, 20, 15.
Want to display the results in a list IN THIS ORDER (i.e. 4, 5, 6, 12, 1, 34, etc.) and be able to display PAGE BY PAGE, e.g. 5 results at a time.
Search itself is quite long and involved , so would prefer not to completely re-do the search for every page.
I have tried the following:
1. Build up search in a temporary table: Holds the order for displaying results, but is lost immediately script terminates, hence cannot display page by page
2. Store ID nos in a string, then pull out and display 5 at a time: Able to maintain between pages in HTML_POST_VARS, but if send the list of IDs to MySQL, order appears to be lost
3. Works if do same as 2. but then retrieve data for IDs one by one. I am concerned this is going to take a long time if many users.
Any suggestions? I am convinced there must be a tidy way to do this in a single search/
Thanks for everyone's help.
David
Constructing a multi-part database search in MySQL e.g. Part 1 delivers IDs 4, 5, 6; Part 2 delivers 12, 1, 34, 8; Part 3 delivers 25, 10, 2, 20, 15.
Want to display the results in a list IN THIS ORDER (i.e. 4, 5, 6, 12, 1, 34, etc.) and be able to display PAGE BY PAGE, e.g. 5 results at a time.
Search itself is quite long and involved , so would prefer not to completely re-do the search for every page.
I have tried the following:
1. Build up search in a temporary table: Holds the order for displaying results, but is lost immediately script terminates, hence cannot display page by page
2. Store ID nos in a string, then pull out and display 5 at a time: Able to maintain between pages in HTML_POST_VARS, but if send the list of IDs to MySQL, order appears to be lost
3. Works if do same as 2. but then retrieve data for IDs one by one. I am concerned this is going to take a long time if many users.
Any suggestions? I am convinced there must be a tidy way to do this in a single search/
Thanks for everyone's help.
David