Re: [PHP] Re: building upon the code RE: Differences

2012-10-05 Thread David McGlone
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.



Re: [PHP] Re: building upon the code RE: Differences

2012-10-05 Thread David McGlone
On Thursday, October 04, 2012 11:37:06 PM Bastien Koert wrote:
> On Thu, Oct 4, 2012 at 10:41 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.
> 
> 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.



Re: [PHP] Re: building upon the code RE: Differences

2012-10-05 Thread Jim Giner

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.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Daniel Brown
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:



-- 

Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Richard S. Crawford
Christopher Walken? Is that you?

On Fri, Oct 5, 2012 at 10:43 AM, Daniel Brown  wrote:

> 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:
>
> 
>
> --
> 
> Network Infrastructure Manager
> http://www.php.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Sláinte,
Richard S. Crawford (rich...@underpope.com)
http://www.underpope.com
Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)


RE: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Steven Staples
> Subject: [PHP] Friday - Return of Brain Teasers
> 
> 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:
> 
> 
> 

Is this supposed to execute to anything?

I got this:

Warning: require(1) [function.require]: failed to open stream: No such file
or directory in C:\xampp\htdocs\cowbell.php on line 1

Fatal error: require() [function.require]: Failed opening required '1'
(include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cowbell.php on line
1


--  I do know what it means, just thought maybe there was something more
significant to it than this...  
"Guess what? I got a fever. And the only prescription...is more cow bell"


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Jonathan Sundquist
It means we require more cowbell.

On Fri, Oct 5, 2012 at 3:34 PM, Steven Staples  wrote:

> > Subject: [PHP] Friday - Return of Brain Teasers
> >
> > 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:
> >
> > 
> >
>
> Is this supposed to execute to anything?
>
> I got this:
>
> Warning: require(1) [function.require]: failed to open stream: No such file
> or directory in C:\xampp\htdocs\cowbell.php on line 1
>
> Fatal error: require() [function.require]: Failed opening required '1'
> (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cowbell.php on line
> 1
>
>
> --  I do know what it means, just thought maybe there was something more
> significant to it than this...
> "Guess what? I got a fever. And the only prescription...is more cow bell"
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Timmy Sjöstedt

That just sounds like a pun than anything else though.

We require new Brainteaser;

On 2012-10-05 22:36, Jonathan Sundquist wrote:

It means we require more cowbell.

On Fri, Oct 5, 2012 at 3:34 PM, Steven Staples  wrote:


Subject: [PHP] Friday - Return of Brain Teasers

 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:

 



Is this supposed to execute to anything?

I got this:

Warning: require(1) [function.require]: failed to open stream: No such file
or directory in C:\xampp\htdocs\cowbell.php on line 1

Fatal error: require() [function.require]: Failed opening required '1'
(include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cowbell.php on line
1


--  I do know what it means, just thought maybe there was something more
significant to it than this...
"Guess what? I got a fever. And the only prescription...is more cow bell"


--
PHP General Mailing 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



Re: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread iostream

If you want to execute some code...

I'm sure you've all heard of the new "goes to" operator by now, but I 
hope it might be new to somebody.


  $i = 10;
  while ($i --> 0) { // while $i goes to 0
echo $i ."\n";
  }

On 2012-10-05 22:34, Steven Staples wrote:

Subject: [PHP] Friday - Return of Brain Teasers

 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:

 



Is this supposed to execute to anything?

I got this:

Warning: require(1) [function.require]: failed to open stream: No such file
or directory in C:\xampp\htdocs\cowbell.php on line 1

Fatal error: require() [function.require]: Failed opening required '1'
(include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cowbell.php on line
1


--  I do know what it means, just thought maybe there was something more
significant to it than this...
"Guess what? I got a fever. And the only prescription...is more cow bell"





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Maciek Sokolewicz

On 05-10-2012 22:50, iostream wrote:

If you want to execute some code...

I'm sure you've all heard of the new "goes to" operator by now, but I
hope it might be new to somebody.

   $i = 10;
   while ($i --> 0) { // while $i goes to 0
 echo $i ."\n";
   }



Haha, nice one :)

Also: don't toppost on this list.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Differences

2012-10-05 Thread Tamara Temple
On Thu, 2012-10-04 at 18:06 -0400, Jim Giner wrote:
> I've read thru 9 responses to the OP and not one of you mentioned that 
> the code presented is problematic in itself.  Very forgiving, but 
> perhaps someone should have suggested that he post "actual code" when 
> looking for help in the future, and not some typing that is supposed to 
> represent the problem.
> 
> In this case, I"m looking for the function he called 
> "completeImageFilename"
> 
> :):)
> 

You might have missed mine:

On Wed, 2012-10-03 at 21:58 -0500, tamouse mailing lists wrote:
> (as a side note, the code you supplied would not work, as the name you
> gave the function was "filename" yet the function you were trying to
> call was "completeImageFileName".)
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Tamara Temple
On Fri, 2012-10-05 at 22:50 +0200, iostream wrote:
> If you want to execute some code...
> 
> I'm sure you've all heard of the new "goes to" operator by now, but I 
> hope it might be new to somebody.
> 
>$i = 10;
>while ($i --> 0) { // while $i goes to 0
>  echo $i ."\n";
>}

Okay, I haven't heard of it, and I don't get it. AFAIK, this "operator"
does not exist, but I don't get the trick that's being applied.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php