[FX.php List] Which is faster?

Jonathan Schwartz jschwartz at exit445.com
Sat Sep 11 14:34:23 MDT 2010


Remove the variable from within the brackets. Value="recid[]"

Jonathan Schwartz
Exit 445 Group
415-370-5011

On Sep 11, 2010, at 1:27 PM, Bob Patin <bob at patin.com> wrote:

> yep... did that. I see this:
> 
>  <input name="recid[5083]" type="checkbox" class="bodyTxt" id="service" value="5083" />
> 
> 
> 
> 
> 
> On Sep 11, 2010, at 3:24 PM, Jonathan Schwartz wrote:
> 
>> Looks ok. Take a look at the source code in your browser. Do to see values inserted for recid?
>> 
>> Jonathan Schwartz
>> Exit 445 Group
>> 415-370-5011
>> 
>> On Sep 11, 2010, at 1:23 PM, Bob Patin <bob at patin.com> wrote:
>> 
>>> Uh... yeah...
>>> 
>>> Here's my checkbox code; I suspect it's the issue:
>>> 
>>> <input name="recid[<?php echo $recid; ?>]" type="checkbox" class="bodyTxt" id="service" value="<?php echo $recid; ?>" />
>>> 
>>> 
>>> On Sep 11, 2010, at 3:21 PM, Jonathan Schwartz wrote:
>>> 
>>>> Were there any boxes checked?  Checkboxes don't produce a post unless a value is checked. 
>>>> 
>>>> Jonathan Schwartz
>>>> Exit 445 Group
>>>> 415-370-5011
>>>> 
>>>> On Sep 11, 2010, at 1:19 PM, Bob Patin <bob at patin.com> wrote:
>>>> 
>>>>> 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
>>>>> 
>>>>> _______________________________________________
>>>>> 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/e6b7eb1e/attachment-0001.html


More information about the FX.php_List mailing list