[FX.php List] Which is faster?
Bob Patin
bob at patin.com
Sat Sep 11 14:19:35 MDT 2010
I got this:
Array ( )
That's it... :)
BP
On Sep 11, 2010, at 3:17 PM, Leo R. Lundgren wrote:
> Huh?
>
> Can you paste it?
>
>
> 11 sep 2010 kl. 22.15 skrev Bob Patin:
>
>> Well, I get back an array(), but I can't tell how many elements are in it...
>>
>> BP
>>
>>
>> On Sep 11, 2010, at 2:59 PM, Leo R. Lundgren wrote:
>>
>>> Not sure, I haven't used FX much at all.
>>>
>>> Start by doing this on the recieving side: print_r($_POST);die();
>>>
>>> It should output the structure of the submitted data, so you can check whether the data is coming in correctly.
>>>
>>>
>>> 11 sep 2010 kl. 21.57 skrev Bob Patin:
>>>
>>>> For some reason, I'm getting all records instead of the 3 that I've checked:
>>>>
>>>> $_POST['recid'] is my checkbox...
>>>>
>>>>
>>>> $query =new FX($serverIP,$webCompanionPort);
>>>> $query->SetDBData($dbname_inv,'web');
>>>> $query->SetDBPassword($wpw,$un);
>>>> $query->SetLogicalOR();
>>>> // loop through the recid array and add the query
>>>> if(isset($_POST['recid']) && is_array($_POST['recid'])) {
>>>> foreach($_POST['recid'] as $recid) {
>>>> $query->AddDBParam('recid', $recid);
>>>> }
>>>> }
>>>> $queryResult = $query->FMFind();
>>>>
>>>> echo $queryResult['foundCount'];
>>>>
>>>> Where's my error? :)
>>>>
>>>>
>>>> On Sep 11, 2010, at 2:27 PM, Leo R. Lundgren wrote:
>>>>
>>>>>
>>>>> 11 sep 2010 kl. 21.21 skrev Bob Patin:
>>>>>
>>>>>> Very cool. I was going to use this:
>>>>>>
>>>>>> <input type="checkbox" name="service<?php echo $counter; ?>">
>>>>>
>>>>> If you do it this way, how are you going to know which posts to query the database for? All you have is a series of numbers not relating to the posts at all (assuming $counter is something that starts at 0 or something and is incremented for each record in page one).
>>>>>
>>>>>> but you're right, I could use the RECID instead, like this:
>>>>>>
>>>>>> <input type="checkbox" name="service[<?php echo $recid; ?>]">
>>>>>
>>>>> Yeah, and if for some reason you cannot use the recId in the query when doing a composite/multi one, then use your own primary key in the table (a unique integer ID field for example).
>>>>>
>>>>>> I'm not familiar with is_array; I assume that it looks at $_POST['service'], which is an array, and the array will only contain elements that are non-empty, is that right? So the unchecked boxes won't build the array?
>>>>>
>>>>> No. See php.net/in_array ;)
>>>>>
>>>>> -|
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>
>> _______________________________________________
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20100911/fa39685b/attachment.html
More information about the FX.php_List
mailing list