[FX.php List] Which is faster?

Bob Patin bob at patin.com
Sat Sep 11 13:33:42 MDT 2010


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).

That was how I was going to do it when I was going to capture the entire record for each item, so I'd end up with a set of data for each item:

description0 = My item
type0 = treadmill
serial0 = 12345
recid0 = 5001

and so on...

But i could potentially end up with a HUGE bunch of data. I like your method much better.

> 
>> 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 going to use RECID, which is always unique.

Thanks for your help!

Now that I'm looking at your code, I'm getting it... scratch my stupid array question.

Here's another one for you though, pertaining to PHP:

Is it better, in a multi-predicate IF statement, to use && instead of "and"?

I've always written

if (($x = 1) and ($y=3)){

Is && a better way?

BP


Bob Patin

Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
iChat: bobpatin
FileMaker 9, 10 & 11 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
--
Expert FileMaker Consulting 
FileMaker Hosting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20100911/b3aae727/attachment.html


More information about the FX.php_List mailing list