Re: [PHP] joins issues again

2008-04-08 Thread Mark J. Reed
SC > > However, i do not want those join records to be appended, only to return the > count of records from sales. So why are you joining in the first place? -- Mark J. Reed <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Could someone tell me what a tilde(~) in PHP does ?

2008-04-08 Thread Mark J. Reed
On Tue, Apr 8, 2008 at 8:50 AM, Mark J. Reed <[EMAIL PROTECTED]> wrote: > That is, the number 47 in binary is 110001, " ... or 10, if you want to be technical. 110001 is 49. :) "The important thing is to understand what you're doing, rather than to get the rig

Re: [PHP] Could someone tell me what a tilde(~) in PHP does ?

2008-04-08 Thread Mark J. Reed
ular bit off, as in which turns off E_DEBUG while leaving the other bits in $flag unchanged. -- Mark J. Reed <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Date comparison Question

2008-04-07 Thread Mark J. Reed
> Am I looking at this all wrong for time difference? strtotime returns an integer number of seconds. The difference between $time1 and $time2 is 105. If you want minutes and seconds, you have to do the math yourself. $interval_min = floor($interval/60); $interval_sec = $interval % 60; ech

Re: [PHP] string

2008-04-07 Thread Mark J. Reed
g List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Mark J. Reed <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Arbitrary mathematical relations, not just hashes

2008-04-06 Thread Mark J. Reed
ess elegant than it could be, IMO: color.inject([]) { |a,p| a << p[0] if p[1] == :red; a } In Perl5 I don't have a better solution than the first one above: my %color = ( apple => 'red', ruby => 'red', banana => 'yellow'); grep { $color{$_} eq '

Re: [PHP] Arbitrary mathematical relations, not just hashes

2008-04-06 Thread Mark J. Reed
As far as languages with two-way relation go, there are many; perhaps the most prototypical is Lisp, in that either member of a pair within an alist can be used to look the pair up, with no extra function or second map definition required. But PHP has pretty good support, too, actually. If you ha