php-general Digest 5 Oct 2012 17:43:52 -0000 Issue 7994
Topics (messages 319370 through 319374):
Re: building upon the code RE: Differences
319370 by: Bastien Koert
319371 by: David McGlone
319372 by: David McGlone
319373 by: Jim Giner
Friday - Return of Brain Teasers
319374 by: Daniel Brown
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On Thu, Oct 4, 2012 at 10:41 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
> On 10/4/2012 10:15 PM, David McGlone wrote:
>>
>> I hope I'm not being a pest.
>>
>> I've played with the return and echo so much today I've finally realized
>> I'm
>> going in circles. But I can say I understand it more than ever.
>>
>> Now whats on my mind is breaking out of this circle and doing more with
>> this
>> code. What I am trying to do now is instead of having ALL the images
>> display,
>> I want to try and group them by their name.
>>
>> If I were using SQL I'd simply use a where clause and be done with it,
>> but
>> I'm not sure what would acomplish the same thing or similiar to a where
>> clause
>> in php.
>>
>>
> I dont' see how a where clause in sql provides you with a result that
> organizes the images by name.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Read the images into an array and then sort the array...glob() gives
you that array so use one of the many sort functions as you like to
get the order you want
--
Bastien
Cat, the other other white meat
--- End Message ---
--- Begin Message ---
On Thursday, October 04, 2012 10:41:17 PM Jim Giner wrote:
> On 10/4/2012 10:15 PM, David McGlone wrote:
> > I hope I'm not being a pest.
> >
> > I've played with the return and echo so much today I've finally realized
> > I'm going in circles. But I can say I understand it more than ever.
> >
> > Now whats on my mind is breaking out of this circle and doing more with
> > this code. What I am trying to do now is instead of having ALL the images
> > display, I want to try and group them by their name.
> >
> > If I were using SQL I'd simply use a where clause and be done with it,
> > but
> > I'm not sure what would acomplish the same thing or similiar to a where
> > clause in php.
>
> I dont' see how a where clause in sql provides you with a result that
> organizes the images by name.
All the images I have that go together have the same name.
12345_1.jpg
12345_2.jpg
12345_3.jpg
So by using a where clause in a MySQL select statement and some php, I'd be
able to grab the result set with the same name.
--
David M.
--- End Message ---
--- Begin Message ---
On Thursday, October 04, 2012 11:37:06 PM Bastien Koert wrote:
> On Thu, Oct 4, 2012 at 10:41 PM, Jim Giner <jim.gi...@albanyhandball.com>
wrote:
> > On 10/4/2012 10:15 PM, David McGlone wrote:
> >> I hope I'm not being a pest.
> >>
> >> I've played with the return and echo so much today I've finally realized
> >> I'm
> >> going in circles. But I can say I understand it more than ever.
> >>
> >> Now whats on my mind is breaking out of this circle and doing more with
> >> this
> >> code. What I am trying to do now is instead of having ALL the images
> >> display,
> >> I want to try and group them by their name.
> >>
> >> If I were using SQL I'd simply use a where clause and be done with it,
> >> but
> >> I'm not sure what would acomplish the same thing or similiar to a where
> >> clause
> >> in php.
> >
> > I dont' see how a where clause in sql provides you with a result that
> > organizes the images by name.
>
> Read the images into an array and then sort the array...glob() gives
> you that array so use one of the many sort functions as you like to
> get the order you want
Thanks. I'll try this today and see what I can do.
--
David M.
--- End Message ---
--- Begin Message ---
On 10/5/2012 8:09 AM, David McGlone wrote:
On Thursday, October 04, 2012 10:41:17 PM Jim Giner wrote:
On 10/4/2012 10:15 PM, David McGlone wrote:
I hope I'm not being a pest.
I've played with the return and echo so much today I've finally realized
I'm going in circles. But I can say I understand it more than ever.
Now whats on my mind is breaking out of this circle and doing more with
this code. What I am trying to do now is instead of having ALL the images
display, I want to try and group them by their name.
If I were using SQL I'd simply use a where clause and be done with it,
but
I'm not sure what would acomplish the same thing or similiar to a where
clause in php.
I dont' see how a where clause in sql provides you with a result that
organizes the images by name.
All the images I have that go together have the same name.
12345_1.jpg
12345_2.jpg
12345_3.jpg
So by using a where clause in a MySQL select statement and some php, I'd be
able to grab the result set with the same name.
--
David M.
True dat. So why don't you just change the "prefix" value coming into
your function? Or - run it once for all prefixes, build a 2nd array of
the unique ones, sort them, display them, let the user pick one, then
re-run it for that prefix alone.
--- End Message ---
--- Begin Message ---
About five-and-a-half years ago, we had a brainteasers thread
going on[1]. Last year it was briefly resurrected[2], and both times
got some good content and dialogue going. So I'd like to reprise the
thread in 2012, as well. Those of you connected to me on Facebook
(parasane) or Twitter (@oidk) might already have seen it, but a simple
one to get things rolling:
<?php require ++$cowbell; ?>
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---