Ok here’s the scenario
I input a load of data into a table. Directly under the “Insert sql” I run a select statement based on finding the data I have just inserted. It always comes up blank. If I go back in to the page and search again then the data appears.
I have taken to closing mysql connections after the insert in the hope that a new connection will in effect refresh the database and display the new data – didn’t work.
With out posting a shed load of code here, is there anything in the protocol / logic that I’m missing?
Cheers,
Lee.
Insert then select ??
Moderator: General Moderators
-
marcelognunez
- Forum Newbie
- Posts: 1
- Joined: Tue Apr 15, 2003 4:18 pm
I have always found it easier to simply break up your tasks in 2 files.
Page 1: Get your data from some previous page, in this page, insert your data.
Page 2: Display your data from page 1.
You could also use a redirect in Page 1 after the inserting of the data is done, so the user technically wouldn't even see page 1, but it would perform the task you needed to do.
Just my .02
Page 1: Get your data from some previous page, in this page, insert your data.
Page 2: Display your data from page 1.
You could also use a redirect in Page 1 after the inserting of the data is done, so the user technically wouldn't even see page 1, but it would perform the task you needed to do.
Just my .02