Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3584 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am trying to get results based from a range.

I have Date_Start and Date_End which are exploded so they meet the filemaker formatting.

Then I take a variable of $dateRange and get it to use those two fields mentioned above.

 

I just get an error however of "errorCode=508&errorMsg=Invalid+value+entered+in+Find+mode"

 

Can you see anything out of the ordinary?

 

Thanks for your help and I appreciate your contributions on the forum. Your helping me out anyway.

 

 

<?php require_once('Connections/User.php'); ?>
<?php
//Setup date to be in US format from AU format
$date_input1 = $_REQUEST['Date_Start'];
$date_array1 = explode ("/", $date_input1);
$date_start = $date_array1[1]."/".$date_array1[0]."/".$date_array1[2];

//Setup date to be in US format from AU format
$date_input2 = $_REQUEST['Date_End'];
$date_array2 = explode ("/", $date_input2);
$date_end = $date_array2[1]."/".$date_array2[0]."/".$date_array2[2];

$dateRange = $_REQUEST['date_start'].'...'.$_REQUEST['date_end'];

$founduser_find = $User->newFindCommand('Users');
$founduser_findCriterions = array('Username'=>'=='.fmsEscape($_SESSION["User_tableLogin"]["user"]),);
foreach($founduser_findCriterions as $key=>$value) {
$founduser_find->AddFindCriterion($key,$value);
}

$foundflights_find = $User->newFindCommand('Flights');
$foundflights_findCriterions = array('Username'=>'=='.fmsEscape($_SESSION["User_tableLogin"]["user"]),'Date' =>$dateRange,'Aircraft_Type'=>$_REQUEST['Aircraft_Type']);
foreach($foundflights_findCriterions as $key=>$value) {
$foundflights_find->AddFindCriterion($key,$value);
}

Posted

Heya Biggles,

 

So... You've created the $date_start and $date_end variables... but not used them to create the search range.

 

Also, you should put code inside code markers on the forum to preserve formatting (the little < > arrows above)

 

On line 13, try:

 

$dateRange = $date_start.'...'.$date_end;
Posted

Thank you. The other day I missed a ',' or something similar and the page wouldn't load.

It took me 30 minutes later to work out my stupidity.

 

Thanks for looking it over. Sometimes it needs someone to have fresh eyes looking at it.

This topic is 3584 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.