[FX.php List] Different results on 2 installations of same DB
and sctipt
Alex Gates
alex at gandrpublishing.com
Sat Apr 28 16:54:16 MDT 2007
As Jonathan mentioned, you are getting an FX Object returned-
Do a print_r($fx_Result); That will give you some information - and also
the URL that fx is using to query filemaker.
Try adding a new field to your shopping layout named "test" and place a
1 in the field in FileMaker -
Then try to do a find on that layout for only that field - -
It should work for you - if it doesn't, then you now the problem is
deeper -- -
Like Jonathan said - start simple and comment out most of your params -
(I'd really try the "test" field and finding 1) if that works, then
uncomment out until you can deduce what line is causing the problem.
If all else fails and you think it is the layout, recreate the layout
and give it a different name and try that -
My guess, though, is that it is something simple. The simple problems
are often overlooked.
Start with a simple request and work from there.
Alex
Vision Computer Consulting wrote:
> I have alot of PHP experience, but not that much with FM. Is it possible
> to have a corrupted layout. I ask because I can do a find on other
> layouts . I put the find on the shopping layout in the body of the
> script and get not result. Put a different find in the same place in the
> code and get a 'foundCount'/
>
>
> On Apr 28, 2007, at 3:07 PM, Jonathan Schwartz wrote:
>
>> This error, from my experience, occurs when fx expects to get an array
>> of returned data after a query, but instead gets none...which it
>> calls a scalar. (my interpretation).
>>
>> So, if I'm correct, then this isn't the problem. It's a result of the
>> problem.
>>
>> Did you turn on Debug to examine the queries that FX is sending FMP?
>> It's tell the story.
>>
>> J
>>
>>
>> At 2:54 PM -0700 4/28/07, Vision Computer Consulting wrote:
>>> I got about this error, but thought I should investigate why it is
>>> happening first.
>>>
>>> Warning: Cannot use a scalar value as an array in
>>> /Users/spcalia/Sites/ram/fx/theprogRAM/php/lib/cust_cart_class.php on
>>> line 1024
>>>
>>> Cose is:
>>>
>>> //define db and layout to be used
>>> $layout="shopping";
>>> $my_fx->SetDBData($db,$layout);
>>> $my_fx->AddDBParam('warranty_type',$cat);
>>> $my_fx->AddDBParam('session',$this->cart_id);
>>> $fx_Result=$my_fx->FMFind();
>>>
>>> $count = $fx_Result['foundCount']; //leave in for
>>> $contents['items'] = $count;
>>> //echo $cat. $count;
>>>
>>> $i = 0;
>>> foreach($fx_Result['data'] as $key=>$value) { //line 1024
>>> $contents[$i] = array(
>>> 'warrantyID'=> $value['warrantyID'][0],
>>> 'name'=> $value['warranties_new::name'][0],
>>> 'name_sub'=>
>>> $value['warranties_new::name_sub'][0],
>>> 'price'=> $value['warranties_new::price'][0],
>>> 'quantity'=> $value['quantity'][0],
>>> 'online_discount'=>
>>> $value['warranties_new::online_discount'][0]
>>> );
>>>
>>> $i++;
>>> }
>>>
>>>
>>> As far as I can tell, the error is telling me $fx_Result is a scalar
>>> instead of an array.
>>>
>>> As I said, exact same code works in another installation.
>>>
>>> Thanks in advance for your help.
>>>
>>> Stephen
>>>
>>>
>>> On Apr 28, 2007, at 12:47 PM, Bob Patin wrote:
>>>
>>>> Well, that tells you that the connection is being made.
>>>>
>>>> I would probably try trimming my query; comment out all but one
>>>> parameter to see if you can get some results. If that doesn't work,
>>>> try duplicating the same search in the db itself (you may have
>>>> already tried this).
>>>>
>>>>
>>>> On Apr 28, 2007, at 2:23 PM, Vision Computer Consulting wrote:
>>>>
>>>>> Error code come back the first time as 401 (to be expected), but
>>>>> then the error code doesn't show up on subsequent finds on the cart.
>>>>>
>>>>> On Apr 28, 2007, at 12:19 PM, Bob Patin wrote:
>>>>>
>>>>>> So other finds work on the web?
>>>>>>
>>>>>> Did you try returning the error code? $findResult['errorCode']
>>>>>>
>>>>>>
>>>>>> On Apr 28, 2007, at 2:14 PM, Vision Computer Consulting wrote:
>>>>>>
>>>>>>> I am getting data on some cases. I am populating page content
>>>>>>> from the db and that works. What is not working is finding
>>>>>>> recording in my shopping cart records. I can search the db
>>>>>>> manually and find the record I am looking for, but not through
>>>>>>> FX. That is the only part that doesn't work. Other Finds work.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> FX.php_List mailing list
>>>>>> FX.php_List at mail.iviking.org <mailto: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 <mailto: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 <mailto: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 <mailto:FX.php_List at mail.iviking.org>
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>
>> --
>> Jonathan Schwartz
>> Exit 445 Group
>> jonathan at exit445.com <mailto:jonathan at exit445.com>
>> http://www.exit445.com
>> 415-381-1852
>> FileMaker 8 Certified Developer
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org <mailto: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