[FX.php List] Conditional value lists with PHP and FileMaker

Anders Monsen andersm at alamark.com
Thu Nov 20 07:38:28 MST 2008


Here's the output for just the first two, also added to pastebin. The  
first district has no schools, all subsequent districts are mapping  
correctly.

http://pastebin.com/m11f8f09d

Array
(
     [vlArrayDistrict] => Array
         (
             [10] => Region III ESC
             [11] => Austwell-Tivoli ISD
         )

     [vlArrayCampus] => Array
         (
             [10] => Array
                 (
                     [] =>
                 )

             [11] => Array
                 (
                     [4.08] => Austwell-Tivoli High
                     [4.1] => Austwell-Tivoli Adm.
                     [4.12] => Tivoli Elem.
                 )
         )

)


On Nov 19, 2008, at 5:39 PM, Gjermund Gusland Thorsen wrote:

> I would like to see the output from:
>
> print_r( $distResult['data'] );
>
> for at least 2 districts
>
> ggt
>
> 2008/11/20 Anders Monsen <andersm at alamark.com>:
>> Yep, from the code it should have worked out that way, and once I  
>> added the
>> [0] so the value appeared and not Array, then it worked as planned.
>>
>> Thanks,
>> Anders
>>
>>
>> On Nov 19, 2008, at 4:41 PM, Tim 'Webko' Booth wrote:
>>
>>>>
>>>>
>>>> However, because the values are not unique in the table, the  
>>>> value list
>>>> is showing up with multiple values for the same district. I may  
>>>> need to see
>>>> if I can get the FileMaker database re-structured to eliminate  
>>>> the duplicate
>>>> values in the current table. I think the complicated way I  
>>>> created the array
>>>> previously filtered it for unique values only.
>>>
>>> If you've sorted the results, then you can compare the previous  
>>> value to
>>> the next to see if it should be written into the drop-down. This  
>>> is example
>>> from one one of my systems with the same issue (well, it's actually
>>> deliberate in this one, as I'm getting a drop-down of available  
>>> lengths
>>> compared to diameters)
>>>
>>>               $lengthDupe = "";
>>>               foreach ($thelengthData as $key => $value) {
>>>                       if ($value['Length_mm'][0] != $lengthDupe) {
>>>                               $lengthOut .= '<option
>>> value="'.$value['Length_mm'][0].'">'.$value['Length_mm'][0].' mm</ 
>>> option>';
>>>                               $lengthDupe = $value['Length_mm'][0];
>>>                       }
>>>               }
>>>
>>> Also, I've done something very similar at
>>> http://www.pleatco.com/search/search.php (which is where the code  
>>> above is
>>> from) for the Dimensions search - I use LAJAX for the call on the  
>>> fly. Let
>>> me know if you want more info about that technique.
>>>
>>> Cheers
>>>
>>> Webko
>>> _______________________________________________
>>> 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
>>
> _______________________________________________
> 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