Author Topic: Search Help  (Read 1622 times)

0 Members and 1 Guest are viewing this topic.

Offline Puma

  • Newbie
  • *
  • Posts: 2
Search Help
« on: November 13, 2007, 11:10:59 AM »
Hi 2 U all

Hope is there someone can help me!

I have few  field   named   date1 | date2 | Price |

                            date1=1 november 2007      date2= 5. december 2007  price=10
                            date1=6 december 2007      date2= 20. january 2008  price=11

if my users want find the price for 2. december 2007 it must show price =10
or if users wnat price for 20. january 2008  it must show  price=11
and so on...
my user just fill one text filed


<form method="GET" action="/cgi-bin/">
<input type="text" name="search" size="20" value="write date to find price">
<input type="submit" value="Search"><br>




sorry i am not good in english..
thanks 4 u all

Offline Jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 1018
    • slipdex
Re: Search Help
« Reply #1 on: November 13, 2007, 01:14:41 PM »

I think I understand what you mean despite the language barrier.  What you are asking is not the easiest situation to have a solution for.  There is no ready made script or trick you can use to accomplish what you want.  Also, if you are allowing the user to fill in a text box for the type of search you are doing there are just too many possible issues that may arise.  It is hard to think of an easy solution without completely changing how you have your database setup and allowing a user to fill in a text box.  The best solution I can think of that has the least possibilities for errors would be to create your database with this structure:

and so on....

Then force the users to select the date from a popup calendar which you can find code for in the tips and tricks that I posted a while back.  Then you can pull up a correct price.

Founder of

Offline Puma

  • Newbie
  • *
  • Posts: 2
Re: Search Help
« Reply #2 on: November 14, 2007, 05:46:27 PM »
Thanks Jason!