Re: [PHP] Re: Copying an Object

2010-09-24 Thread Peter Lind
On 25 September 2010 00:11, Daniel Kolbo wrote: > On 9/24/2010 8:35 AM, Peter Lind wrote: >> On 24 September 2010 14:22, Bob McConnell wrote: >>> From: David Hutto >>> On Fri, Sep 24, 2010 at 4:09 AM, Gary wrote: > Daniel Kolbo wrote: > >> Say you have two classes: human and mal

Re: [PHP] Re: Copying an Object

2010-09-24 Thread Daniel Kolbo
On 9/24/2010 6:11 PM, Daniel Kolbo wrote: > On 9/24/2010 8:35 AM, Peter Lind wrote: >> On 24 September 2010 14:22, Bob McConnell wrote: >>> From: David Hutto >>> On Fri, Sep 24, 2010 at 4:09 AM, Gary wrote: > Daniel Kolbo wrote: > >> Say you have two classes: human and male. Fur

Re: [PHP] Re: Copying an Object

2010-09-24 Thread Daniel Kolbo
> > On 9/24/2010 4:09 AM, Gary wrote: >> Daniel Kolbo wrote: >> >>> Say you have two classes: human and male. Further, say male extends >>> human. Let's say you have a human object. Then later you want to make >>> that human object a male object. This seems to be a pretty reasonable >>> thing

Re: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Ashley Sheridan
On Fri, 2010-09-24 at 16:08 -0400, Joshua Kehn wrote: > On Sep 24, 2010, at 4:04 PM, Ashley Sheridan wrote: > > > On Fri, 2010-09-24 at 15:54 -0400, Bob McConnell wrote: > > > >> From: tedd > >> > >>> At 2:23 PM -0400 9/24/10, Bob McConnell wrote: > > A switch works when a single tes

RE: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Ashley Sheridan
On Fri, 2010-09-24 at 15:54 -0400, Bob McConnell wrote: > From: tedd > > > At 2:23 PM -0400 9/24/10, Bob McConnell wrote: > >> > >>A switch works when a single test can dispatch all possible branches. > If > >>you have a series of tests where each looks for a different subset of > >>conditions,

RE: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Ashley Sheridan
On Fri, 2010-09-24 at 15:44 -0400, Steve Staples wrote: > this would be the same as: > (commented below) > > On Fri, 2010-09-24 at 15:30 -0400, tedd wrote: > > At 2:23 PM -0400 9/24/10, Bob McConnell wrote: > > > > > >A switch works when a single test can dispatch all possible branches. If > > >y

Re: [PHP] Database Administration

2010-09-24 Thread Bastien Koert
On Fri, Sep 24, 2010 at 3:50 PM, Bob McConnell wrote: > From: tedd > >>At 2:36 PM -0400 9/24/10, Bastien Koert wrote: >>>On Fri, Sep 24, 2010 at 2:26 PM, tedd wrote:  At 2:09 PM -0400 9/24/10, Bastien Koert wrote: > > �...@tedd, > >  He wants not techie users to create new sy

RE: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Bob McConnell
From: tedd > At 2:23 PM -0400 9/24/10, Bob McConnell wrote: >> >>A switch works when a single test can dispatch all possible branches. If >>you have a series of tests where each looks for a different subset of >>conditions, you need an elseif. > Not so, O'wise one. > > This will work: > > swit

RE: [PHP] Database Administration

2010-09-24 Thread Bob McConnell
From: tedd >At 2:36 PM -0400 9/24/10, Bastien Koert wrote: >>On Fri, Sep 24, 2010 at 2:26 PM, tedd wrote: >>> At 2:09 PM -0400 9/24/10, Bastien Koert wrote: @tedd, He wants not techie users to create new systems for their clients when they sign up. It involves creatin

RE: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Steve Staples
this would be the same as: (commented below) On Fri, 2010-09-24 at 15:30 -0400, tedd wrote: > At 2:23 PM -0400 9/24/10, Bob McConnell wrote: > > > >A switch works when a single test can dispatch all possible branches. If > >you have a series of tests where each looks for a different subset of > >c

Re: [PHP] Database Administration

2010-09-24 Thread tedd
At 2:36 PM -0400 9/24/10, Bastien Koert wrote: On Fri, Sep 24, 2010 at 2:26 PM, tedd wrote: At 2:09 PM -0400 9/24/10, Bastien Koert wrote: @tedd, He wants not techie users to create new systems for their clients when they sign up. It involves creating a DB and he's wondering about secur

RE: [PHP] if/elseif being treated as if/if

2010-09-24 Thread tedd
At 2:23 PM -0400 9/24/10, Bob McConnell wrote: A switch works when a single test can dispatch all possible branches. If you have a series of tests where each looks for a different subset of conditions, you need an elseif. Bob McConnell Bob: Not so, O'wise one. This will work: switch(1)

Re: [PHP] Database Administration

2010-09-24 Thread Bastien Koert
On Fri, Sep 24, 2010 at 2:26 PM, tedd wrote: > At 2:09 PM -0400 9/24/10, Bastien Koert wrote: >> >> @tedd, >> >> He wants not techie users to create new systems for their clients when >> they sign up. It involves creating a DB and he's wondering about >> security for that. The main part of the app

Re: [PHP] Database Administration

2010-09-24 Thread tedd
At 2:09 PM -0400 9/24/10, Bastien Koert wrote: @tedd, He wants not techie users to create new systems for their clients when they sign up. It involves creating a DB and he's wondering about security for that. The main part of the app needs the least priv's to run (select, update, insert [,delet

RE: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Jay Blanchard
[snip] I am not in the majority when I say for conditions where you have more than two options use a switch control and not an elseif. In 40+ years of programming, I have never used elseif because the control confuses me. It is *much* easier for me to use, understand, and document a switch stat

Re: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Andy McKenzie
I found the problem while I was copying the code over. The problem is that the if triggers in loop one, and the elseif triggers in loop two. In other words, it does exactly what it's supposed to, I just didn't think through what the loop would accomplish. Now to figure out how to make it do what

RE: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Bob McConnell
From: tedd > At 1:50 PM -0400 9/24/10, Andy McKenzie wrote: >>Hey folks, >> >> Here's the deal. I have the following code: >> >>if($col_vals[$i][$val['column']] == $search_result[0][$col]) >> { echo ' selected="selected"'; } >>elseif($val['default'] == $col_vals[$i][$val['column']]) >

Re: [PHP] if/elseif being treated as if/if

2010-09-24 Thread tedd
At 1:50 PM -0400 9/24/10, Andy McKenzie wrote: Hey folks, Here's the deal. I have the following code: if($col_vals[$i][$val['column']] == $search_result[0][$col]) { echo ' selected="selected"'; } elseif($val['default'] == $col_vals[$i][$val['column']]) { echo ' selected="

Re: [PHP] Database Administration

2010-09-24 Thread Bastien Koert
On Fri, Sep 24, 2010 at 2:05 PM, tedd wrote: > At 11:19 AM +0100 9/24/10, Tom Barrett wrote: >> >> On 22 September 2010 21:40, Bastien Koert wrote: >> >>>  Not at all. What I would suggest is that you create a separate mysql >>>  user that is used exclusively by the script to do the create stuff.

Re: [PHP] Database Administration

2010-09-24 Thread tedd
At 11:19 AM +0100 9/24/10, Tom Barrett wrote: On 22 September 2010 21:40, Bastien Koert wrote: Not at all. What I would suggest is that you create a separate mysql user that is used exclusively by the script to do the create stuff. The regular application user account should not have those

Re: [PHP] if/elseif being treated as if/if

2010-09-24 Thread Marc Guay
if(1 == 1){ echo 'here'; } elseif(1 == 1){ echo 'here"'; } Will only echo "here" once. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] if/elseif being treated as if/if

2010-09-24 Thread chris h
Andy I see no reason why both echo's would fire; unless this block of code gets executed multiple times. can we see more of the code? Chris H. On Fri, Sep 24, 2010 at 1:50 PM, Andy McKenzie wrote: > Hey folks, > > Here's the deal. I have the following code: > > if($col_vals[$i][$val['column

[PHP] if/elseif being treated as if/if

2010-09-24 Thread Andy McKenzie
Hey folks, Here's the deal. I have the following code: if($col_vals[$i][$val['column']] == $search_result[0][$col]) { echo ' selected="selected"'; } elseif($val['default'] == $col_vals[$i][$val['column']]) { echo ' selected="selected"'; } It's supposed to check whether t

Re: [PHP] Copying an Object

2010-09-24 Thread Nathan Nobbe
On Thu, Sep 23, 2010 at 12:24 AM, Peter Lind wrote: > On 23 September 2010 02:14, Daniel Kolbo wrote: > > *snip* > > > On 9/22/2010 9:11 AM, chris h wrote: > > Say you have two classes: human and male. Further, say male extends > > human. Let's say you have a human object. Then later you want

Re: [PHP] Database Administration

2010-09-24 Thread Andrew Ballard
On Fri, Sep 24, 2010 at 6:19 AM, Tom Barrett wrote: [snip] > I'm not actually that familiar with DB admin to that extent. I have either > app users with lock+crud on specific databases, or root. As a an aside, > would you know if there is a level of permissions for a user between app and > root th

Re: [PHP] Re: Copying an Object

2010-09-24 Thread chris h
"Gang of Four" http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612 An excellent book on OOP. Chris H. On Fri, Sep 24, 2010 at 9:34 AM, Bob McConnell wrote: > From: chris h > > > On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind > wrote: > > > > On 24 Septem

RE: [PHP] Re: Copying an Object

2010-09-24 Thread Bob McConnell
From: chris h > On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind wrote: > > On 24 September 2010 14:22, Bob McConnell wrote: > > From: David Hutto > > > >> On Fri, Sep 24, 2010 at 4:09 AM, Gary wrote: > >>> Daniel Kolbo wrote: > >>> > Say you have two

Re: [PHP] Re: Copying an Object

2010-09-24 Thread chris h
On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind wrote: > On 24 September 2010 14:22, Bob McConnell wrote: > > From: David Hutto > > > >> On Fri, Sep 24, 2010 at 4:09 AM, Gary > wrote: > >>> Daniel Kolbo wrote: > >>> > Say you have two classes: human and male. Further, say male extends >

RE: [PHP] Re: Copying an Object

2010-09-24 Thread Bob McConnell
From: Peter Lind > On 24 September 2010 14:22, Bob McConnell wrote: >> From: David Hutto >> >>> On Fri, Sep 24, 2010 at 4:09 AM, Gary wrote: Daniel Kolbo wrote: > Say you have two classes: human and male.  Further, say male extends > human.  Let's say you have a human object.  

Re: [PHP] Heredocs, print_r() and newline "\n" and fnmatch() - curious failures ...

2010-09-24 Thread Steve Staples
As far as I know, you wont get any line breaks. I would suggest putting the results into tags to preserve formatting. whenever I do a print_r(), i also encapsulate it within a tag so it is readable. on another note, when I use variables within double quotes "" (or even the heredoc (but i use s

Re: [PHP] Re: Copying an Object

2010-09-24 Thread Peter Lind
On 24 September 2010 14:22, Bob McConnell wrote: > From: David Hutto > >> On Fri, Sep 24, 2010 at 4:09 AM, Gary wrote: >>> Daniel Kolbo wrote: >>> Say you have two classes: human and male.  Further, say male extends human.  Let's say you have a human object.  Then later you want to make

RE: [PHP] Re: Copying an Object

2010-09-24 Thread Bob McConnell
From: David Hutto > On Fri, Sep 24, 2010 at 4:09 AM, Gary wrote: >> Daniel Kolbo wrote: >> >>> Say you have two classes: human and male.  Further, say male extends >>> human.  Let's say you have a human object.  Then later you want to make >>> that human object a male object.  This seems to be a

Re: [PHP] Heredocs, print_r() and newline "\n" and fnmatch() - curious failures ...

2010-09-24 Thread Peter Lind
On 23 September 2010 21:47, YAD(YetAnotherDavid) wrote: > This code is 95% cut and paste from the PHP manual examples - > the Types/Strings/Heredocs section and the Filesystem/fnmatch pages. > There are actually two questions here - I have combined the code into one > test file ... the strings in

Re: [PHP] Database Administration

2010-09-24 Thread Tom Barrett
On 22 September 2010 21:40, Bastien Koert wrote: > Not at all. What I would suggest is that you create a separate mysql > user that is used exclusively by the script to do the create stuff. > The regular application user account should not have those privileges > at all. > I'm not actually that

[PHP] Heredocs, print_r() and newline "\n" and fnmatch() - curious failures ...

2010-09-24 Thread YAD(YetAnotherDavid)
This code is 95% cut and paste from the PHP manual examples - the Types/Strings/Heredocs section and the Filesystem/fnmatch pages. There are actually two questions here - I have combined the code into one test file ... the strings in the code contain the questions .. at the end I have inserted th

Re: [PHP] Re: Copying an Object

2010-09-24 Thread David Hutto
On Fri, Sep 24, 2010 at 4:09 AM, Gary wrote: > Daniel Kolbo wrote: > >> Say you have two classes: human and male.  Further, say male extends >> human.  Let's say you have a human object.  Then later you want to make >> that human object a male object.  This seems to be a pretty reasonable >> thing