You are here: Re: linking a research form with a display page « PHP Programming Language « IT news, forums, messages
Re: linking a research form with a display page

Posted by phil67b@gmail.com on 08/30/07 19:36

On 30 août, 19:13, ELINTPimp <smsi...@gmail.com> wrote:
> On Aug 30, 12:56 pm, "phil...@gmail.com" <phil...@gmail.com> wrote:
>
> > 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация