[FX.php List] Solved? Anyone got a sober solution to a date range search?

Gjermund Gusland Thorsen ggt667 at gmail.com
Tue Aug 12 17:55:53 MDT 2008


well, in my solution

referring uri contains year=2008&month=7

then I do a small calculation on that and the output is

7.1.2008...7.31.2008 and it works

if I make the calculation generate the following:
7/1/2008...7/31/2008 error 500 shows up

ggt

2008/8/13 Tim 'Webko' Booth <tim at nicheit.com.au>:
>
> On 13/08/2008, at 9:50 AM, Gjermund Gusland Thorsen wrote:
>
>> if you use the dots, you will probably not need to do urldecode()...
>
> Fails with error 500 if I don't (on a GET...)
>
> Cheers
>
> Webko
>>
>>
>> ggt
>>
>> 2008/8/13 Tim 'Webko' Booth <tim at nicheit.com.au>:
>>>
>>> On 13/08/2008, at 3:32 AM, Gjermund Gusland Thorsen wrote:
>>>
>>>> Well date searching works with mm/dd/ccyy, however when ...mm/dd/yyyy is
>>>> added,
>>>> the reply is error: 500 for both my FMSA installations 7.0 and 8.0v4r2
>>>
>>> Interesting - I'vve not done a lot of date range searching but now have
>>> had
>>> a play...
>>>
>>> If the date range is hard-coded in the php, it seems to be fine:
>>>
>>> http://apachescricket.com/schedule_date.php
>>>
>>> Will hard code for 01/01/2008...12/12/2008
>>>
>>> Adding a parameter for the 1st date search:
>>>
>>> http://apachescricket.com/schedule_date.php?date1=19/04/2008
>>>
>>> and hard-coding the second also worked straight away
>>>
>>> Adding the second parameter:
>>>
>>>
>>> http://apachescricket.com/schedule_date.php?date1=04/19/2008&date2=10/19/2008
>>>
>>> initially failed, but then I added urldecode and it was fine
>>>
>>> <?php
>>>      if  (isset($_REQUEST['date1'])){
>>>              $date1 = urldecode($_REQUEST['date1']);
>>>      } else {
>>>              $date1 = "04/14/2008";
>>>      }
>>>      if  (isset($_REQUEST['date2'])){
>>>              $date2 = urldecode($_REQUEST['date2']);
>>>      } else {
>>>              $date2="12/12/2008";
>>>      }
>>>      $dateSearch = $date1."...".$date2;
>>>      echo "Search= ".$dateSearch;
>>>      //Find matches
>>>      $matchObj=new FX($dbHost,$port,$dbType,$conType);
>>>      $matchObj -> setDBPassword($dbPass,$dbUser);
>>>      $matchObj -> setDBData($dbName,'MATCH', 'all');
>>>      $matchObj -> AddDBParam('Week1', $dateSearch , 'eq');
>>> //      $matchObj -> AddDBParam('Grade', $grade , 'eq');
>>>      $matchObj -> AddDBParam('Innings', "1" , 'eq');
>>>      $matchObj -> AddSortParam('_kp_MatchNumber', 'ascend');
>>>      $matchData = $matchObj -> FMFind();
>>> ?>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> Tim 'Webko' Booth :: Niche IT Pty Ltd, Sydney, Australia
> [e] tim at nicheit.com.au :: [m] 0418 993 306
>
>
>
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>


More information about the FX.php_List mailing list