Page 1 of 1

what will be my outcome in this situation?

Posted: Sun Nov 05, 2006 3:07 pm
by TooCrooked
lets say:
example wrote:@ 10:20AM DATABASE_1 has TABLE_1 with five records:
(format: "record number" = "value")
1=one
2=two
3=three
4=four
5=five
6=six
7=seven
8=eight
9=nine
10=ten

@ 10:21AM DATABASE_1 updates TABLE_1:
1-one
2-two
3-three
4-four
5-five
6-unos
7-dos
8-tres
9-quatro
10-cinco

@ 10:22AM, USER-A wants to sort the results of his 10:20AM query of TABLE_1 alphabetically.
So......

i know exactly how to make the events that occur at 10:20AM and 10:21 happen. no problem.

but, at 10:22AM, when user-A wants his alphabetic sort of his 10:20AM query, i need to know what my options are.. will:

- the 10:20AM query persist in "memory" of SQL... then my PHP script can somehow be programmed to access the 10:20 results (saved in SQL "memory"), sort them accordingly, and then return the results to be printed out on some web page

OR is it more like:

- in order to have any more access to the results of the 10:20AM query, you have to save the results into something (an array for instance), and then *somehow* pass the array from current PHP page to the next PHP page that will do the sorting. all this because SQL (when being talked to from PHP) can only be referenced in "instances", and not as a "session"

... this is as well as i can put my question. please help!

Posted: Sun Nov 05, 2006 6:00 pm
by Chris Corbyn
Once the data has been modifed by UPDATE you'll lose the old data.

Do you care to elaborate on the specifics of your needs here? It sounds as though you should perhaps be logging transactions if you need to keep a constant log of the history of the information in the database at any one time.

FYI, MySQL can run operations triggered by UPDATE queries (hint).

Posted: Sun Nov 05, 2006 8:18 pm
by TooCrooked
i want users to be able to "own their results". this would allow them to sort their results in whatever ways i make possible, but they would see sorted results based on their original query, even if that query happened hours ago, and the database was just updated with 100% new data sometime after that.

so youre saying that SQL does not have the ability to create a "session of results" in any way or fashion?

?

Posted: Sun Nov 05, 2006 8:28 pm
by feyd
Unless you do the sorting client side (with Javascript) or cache the results you are displaying to the user, no. Caching could simply involve a session data store.

Posted: Mon Nov 06, 2006 12:41 am
by Chris Corbyn
If you want this to be completely persistent, I think you're going to need to some data set identifier and just waste DB space creating a new data set for each time you update the DB.

Posted: Fri Nov 10, 2006 7:41 pm
by TooCrooked
im hopeful that i can use PHP's session variable to create the effect i want. thanks!