473,400 Members | 2,163 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,400 software developers and data experts.

linking a research form with a display page

Hello everybody,

I have a page rech.php where I'm doing a multi-criteria research Ex.
choose your car model, choose your country.
After validation of my form, on the same page, the lines will be
displayed (I put a max limitation of 500 lines). Ex. list of cars Fiat
to buy in UK.

A clic on a line will bring me to the display page disp.php Ex. I will
clic on the car n° 5 =<a href="disp.php?
line=5&country=uk&model=Fiat">car n°5</A>.
As you can see disp.php will receive in parameters all the
informations of my query (country=, model=) and I will re-execute the
big multi-criteria query in disp.php for each page!
But if the webmaster will delete the record n°4, I'm bloqued. I'm in
disp.php on the record n°5 and if I clic on the previous button, the
script will look for the record n°4 which doesn't existe anymore.

Here is my big question : Is there a solution to do only once the big
multi-criteria request and save it in a temporary table (but then when
do I need to delete the temp table) or an other solution to do things
better ?

Thanks for your help

Phil

Aug 30 '07 #1
3 1934
On Aug 30, 12:56 pm, "phil...@gmail.com" <phil...@gmail.comwrote:
Hello everybody,

I have a page rech.php where I'm doing a multi-criteria research Ex.
choose your car model, choose your country.
After validation of my form, on the same page, the lines will be
displayed (I put a max limitation of 500 lines). Ex. list of cars Fiat
to buy in UK.

A clic on a line will bring me to the display page disp.php Ex. I will
clic on the car n° 5 =<a href="disp.php?
line=5&country=uk&model=Fiat">car n°5</A>.
As you can see disp.php will receive in parameters all the
informations of my query (country=, model=) and I will re-execute the
big multi-criteria query in disp.php for each page!
But if the webmaster will delete the record n°4, I'm bloqued. I'm in
disp.php on the record n°5 and if I clic on the previous button, the
script will look for the record n°4 which doesn't existe anymore.
so the problem is when/if the webmaster deletes a record between the
time the user initially requests the listing and when he finally
clicks on that record (or previous, in your example)?
Here is my big question : Is there a solution to do only once the big
multi-criteria request and save it in a temporary table (but then when
do I need to delete the temp table) or an other solution to do things
better ?
Yes...but first are you sure you want to do this? If the webmaster,
or whoever, deletes a record in the database, I'm sure there was a
reason for it...the data isn't valid anymore and the user shouldn't
see this ghost data.

Depending on your database, you can create a persistent session,
create a temp table within the database with the data you want to
preserve, and when the session is closed the temp table dies. Now,
persistent DB sessions have their own set of problems, in addition to
the data "ghosting" I talked about as well as the user getting old
data. For example, what if the user searches and your webmaster ADDS
data to the database? That data won't be available until they kill
their session and create another?

A temp table might not be best solution for temporarily saving your
data either, but that's what you asked for. Depending on your data
size, it might be best for a namespace within the $_SESSION
superglobal...

Still, I highly suggest you consider all the effect this would have on
your application. Yes, there are some downsides to typical web
application development (in this case, a new request per page
refresh), but that also opens doors to others.

Steve

Aug 30 '07 #2
On 30 août, 19:13, ELINTPimp <smsi...@gmail.comwrote:
On Aug 30, 12:56 pm, "phil...@gmail.com" <phil...@gmail.comwrote:
Hello everybody,
I have a page rech.php where I'm doing a multi-criteria research Ex.
choose your car model, choose your country.
After validation of my form, on the same page, the lines will be
displayed (I put a max limitation of 500 lines). Ex. list of cars Fiat
to buy in UK.
A clic on a line will bring me to the display page disp.php Ex. I will
clic on the car n° 5 =<a href="disp.php?
line=5&country=uk&model=Fiat">car n°5</A>.
As you can see disp.php will receive in parameters all the
informations of my query (country=, model=) and I will re-execute the
big multi-criteria query in disp.php for each page!
But if the webmaster will delete the record n°4, I'm bloqued. I'm in
disp.php on the record n°5 and if I clic on the previous button, the
script will look for the record n°4 which doesn't existe anymore.

so the problem is when/if the webmaster deletes a record between the
time the user initially requests the listing and when he finally
clicks on that record (or previous, in your example)?
Here is my big question : Is there a solution to do only once the big
multi-criteria request and save it in a temporary table (but then when
do I need to delete the temp table) or an other solution to do things
better ?

Yes...but first are you sure you want to do this? If the webmaster,
or whoever, deletes a record in the database, I'm sure there was a
reason for it...the data isn't valid anymore and the user shouldn't
see this ghost data.
Thanks Steve for your long answer.
To better understand, imagine a big dating site where you have each
minutes a new user. If I'm look for the last 500 new users, during my
browsing in the disp.php I will have new users and maybe some other
being invalidated... A lot of changing during my consultation. Of
course, it's not important if I didn't see the new users during my
session.

Depending on your database, you can create a persistent session,
create a temp table within the database with the data you want to
preserve, and when the session is closed the temp table dies. Now,
persistent DB sessions have their own set of problems, in addition to
the data "ghosting" I talked about as well as the user getting old
data. For example, what if the user searches and your webmaster ADDS
data to the database? That data won't be available until they kill
their session and create another?

A temp table might not be best solution for temporarily saving your
data either, but that's what you asked for. Depending on your data
size, it might be best for a namespace within the $_SESSION
superglobal...

Still, I highly suggest you consider all the effect this would have on
your application. Yes, there are some downsides to typical web
application development (in this case, a new request per page
refresh), but that also opens doors to others.

Steve
I'm presuming temporary table will then be the best solution ?
Is it easy to do ?
I heard .net has a solution to create a sort of automatic table in
cache mode... I'm sure there should be someting easy in php to manage
this king of search->browse in display
Aug 30 '07 #3
On Aug 30, 3:36 pm, "phil...@gmail.com" <phil...@gmail.comwrote:
On 30 août, 19:13, ELINTPimp <smsi...@gmail.comwrote:
On Aug 30, 12:56 pm, "phil...@gmail.com" <phil...@gmail.comwrote:
Hello everybody,
I have a page rech.php where I'm doing a multi-criteria research Ex.
choose your car model, choose your country.
After validation of my form, on the same page, the lines will be
displayed (I put a max limitation of 500 lines). Ex. list of cars Fiat
to buy in UK.
A clic on a line will bring me to the display page disp.php Ex. I will
clic on the car n° 5 =<a href="disp.php?
line=5&country=uk&model=Fiat">car n°5</A>.
As you can see disp.php will receive in parameters all the
informations of my query (country=, model=) and I will re-executethe
big multi-criteria query in disp.php for each page!
But if the webmaster will delete the record n°4, I'm bloqued. I'm in
disp.php on the record n°5 and if I clic on the previous button, the
script will look for the record n°4 which doesn't existe anymore.
so the problem is when/if the webmaster deletes a record between the
time the user initially requests the listing and when he finally
clicks on that record (or previous, in your example)?
Here is my big question : Is there a solution to do only once the big
multi-criteria request and save it in a temporary table (but then when
do I need to delete the temp table) or an other solution to do things
better ?
Yes...but first are you sure you want to do this? If the webmaster,
or whoever, deletes a record in the database, I'm sure there was a
reason for it...the data isn't valid anymore and the user shouldn't
see this ghost data.

Thanks Steve for your long answer.
To better understand, imagine a big dating site where you have each
minutes a new user. If I'm look for the last 500 new users, during my
browsing in the disp.php I will have new users and maybe some other
being invalidated... A lot of changing during my consultation. Of
course, it's not important if I didn't see the new users during my
session.
Depending on your database, you can create a persistent session,
create a temp table within the database with the data you want to
preserve, and when the session is closed the temp table dies. Now,
persistent DB sessions have their own set of problems, in addition to
the data "ghosting" I talked about as well as the user getting old
data. For example, what if the user searches and your webmaster ADDS
data to the database? That data won't be available until they kill
their session and create another?
A temp table might not be best solution for temporarily saving your
data either, but that's what you asked for. Depending on your data
size, it might be best for a namespace within the $_SESSION
superglobal...
Still, I highly suggest you consider all the effect this would have on
your application. Yes, there are some downsides to typical web
application development (in this case, a new request per page
refresh), but that also opens doors to others.
Steve

I'm presuming temporary table will then be the best solution ?
Is it easy to do ?
I heard .net has a solution to create a sort of automatic table in
cache mode... I'm sure there should be someting easy in php to manage
this king of search->browse in display
I will state that I still don't understand why you would want to show
your users old data, but that might be just because I'm not reading
things correctly. There are reasons for caching data, however, so I'll
address that issue, not your reasoning for doing this. (Although, be
sure that's really what your customers want and, maybe more important,
are expecting).

since you want to cache your data off the main database table(s), you
have a couple choices...each with there own positives and negatives.
Lets focus on the performance aspect, though. If your pulling data
from a normalized database, possibly with a complex query or set of
queries, you would probably benefit from caching the data in the
database. This option becomes more attractive if you don't have to
initially process the data and send it back, but rather tell the SQL
server to create the temp table based on your query and from that
point on, use that one. If the dataset is small, however, you might
want to consider caching the data in files/SQLlite on the server.
Doing this of course eliminates the overhead of calling the database.

Just like if you were looking into a .NET solution, your going to need
some external tools. In PHP's case (and I only speak for PHP, not
comparison to .NET), these tools are actually 1st party. Included in
Zend Framework is a neat set of classes for frontend and backend cache
management. Don't let the name "Framework" make you stand off,
though. It's not like you have to actually use the framework in a MVC
sense, you can just use the cache classes without any overhead of the
others thanks to the loosely coupled design. And, if your already
using a MVC Framework like Cake or Symfony, you can easily mash up the
ZF classes.

Take a look at the ZF cache classes. http://framework.zend.com/manual/en/zend.cache.html

Also, you'll need to do a little research on your specific database
and the commands necessary to create a temp table. I've achieved this
on a MSSQL05 server, so I know it can be done. If you have some
problems finding this information, just let me know your DB or visit
you friendly neighborhood db-specific group. =)

Aug 30 '07 #4

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

Similar topics

1
by: Kirok | last post by:
Hey Everyone, Thanks for reading, heres what I'm trying to do I have an array of say 10 items each item contains the text / description for a room. Now I would like to create a class (lets...
3
by: Ken | last post by:
I have a win 2000 database of autographs and scanned photos. They are in the SAME directory. In the table, my "ImagePath" text field shows JUST the image name (i.e. "blank.jpg"). I have an image...
2
by: TheTamdino | last post by:
One of the things that is common between most genealogy databases is that they will have one screen were you log all the information for a given person and then (maybe) have a link to a source...
0
by: Pat Sagaser via .NET 247 | last post by:
I'm using a repeater with a dynamic template. I don't know the fields to display (or how many) until runtime. I have everything working except for linking Button events to the repeaters ItemCommand...
14
by: kempy535 | last post by:
Hi Im have aproblem with a site im trying to design. What Im trying to do is when you click on an image it links to another page and displays data that is relevent to its self. The images are stored...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
1
by: Sudhakar | last post by:
i am using a self submitting for using php <form action="<?php echo $_SERVER; ?>" method="POST" id="test2" name="registrationform"> the registration page starts with a lot of terms and other...
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.