473,405 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Automatic requery

I'm sure I'm missing something simple here; help will be appreciated.

I've got a search form that displays records from a MySQL db matching
criteria entered by the user; the search form appears again below the
results. Each row of the recordset is shown with edit and delete links,
which call other .php pages (one for editing, one for confirmation of
the delete). All that works fine.

The edit and delete-confirm pages have links to return to the search
results, using javascript:history.go(?). This also works fine.

Trouble is, the edit or deletion is (of course) not reflected when the
user returns to the search results.

Ideally, the "return to search results" links would automatically
requery the db before showing the results. The only way I've found to
do that is to preserve the user's entries in the form, which would be
kinda handy anyway since it would make for easier refinement of the
search -- but if I do that, my "Reset" button doesn't work; the form
continues to show the user's previous entries.

What am I missing?

Sep 10 '06 #1
2 3395
*** st**@qtandthegeek.com escribió/wrote (9 Sep 2006 18:58:51 -0700):
Trouble is, the edit or deletion is (of course) not reflected when the
user returns to the search results.
Tell the browser the page must not be cached:

header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) . ' GMT');
header('Expires: ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');

I'm not 100% sure but this may help.

--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Sep 10 '06 #2
Thanks, Alvaro, but I'm told that approach isn't reliable because not
all browsers recognize those tags. However, I did have an idea in the
middle of the night (sad, I know) that actually works: I changed the
reset button to a second submit button. The form's action reposts the
page, and the code already tested for the *actual* submit button before
doing the search -- so now my second submit button just reposts the
page, without search results and with a cleared search form.

Thanks again, though, I appreciate the idea.

Alvaro G. Vicario wrote:
*** st**@qtandthegeek.com escribió/wrote (9 Sep 2006 18:58:51 -0700):
Trouble is, the edit or deletion is (of course) not reflected when the
user returns to the search results.

Tell the browser the page must not be cached:

header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) .. ' GMT');
header('Expires: ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');

I'm not 100% sure but this may help.

--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Sep 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dudi Nissan | last post by:
Hi I need to display DataGraid that refresh automatic every 30 seconds ? Thank you.
3
by: pbbriggs | last post by:
I will try to be as descriptive as possible, but this error has me stumped and I am not sure what relevant info to include.... I am running Access XP on a Windows XP machine. I initially began...
3
by: Darleen | last post by:
I am seeking conceptual here on how to get started with a "3D Matrix" in Access. We run a training center which holds multiple classes in multiple cities at multiple times. So I need to create a...
1
by: Franck Foschiatti | last post by:
How can I save new values in a table and directly see it in a form combobox without closing and re-opening the form and without losing the entered values? The second use is to do a request...
2
by: Heather | last post by:
I have a Access 2000 database. I have one table with two fields Location and Section I have 2 list boxes on a form - one for location and one for section Is there a way to when the user selects...
2
by: David Richards | last post by:
Hi, Hopefully someone can help me. I have setup a continuous form that displays customer names and addresses. I have then place a txt box on the form header. Using the onChange event I've setup...
20
by: MS | last post by:
Access 97 I want to requery the data being displayed on a form, then I want to return to the record I was in. Why doesn't this code work? Private Sub CmdRefsh_Click()
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
20
by: Constantine AI | last post by:
Hi I have this code which i thought was perfect maybe a bit of a mess but it works. The only problem is that the rst!PONo does not look at the table properly and generate a continuing number, which i...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.