php-general Digest 24 Sep 2010 08:09:25 -0000 Issue 6957

2010-09-24 Thread php-general-digest-help
php-general Digest 24 Sep 2010 08:09:25 - Issue 6957 Topics (messages 308272 through 308273): Re: module add on Suse 10.3 308272 by: Patrick Serru Re: Copying an Object 308273 by: Gary Administrivia: To subscribe to the digest, e-mail:

Re: [PHP] Re: Copying an Object

2010-09-24 Thread David Hutto
On Fri, Sep 24, 2010 at 4:09 AM, Gary php-gene...@garydjones.name 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

[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

Re: [PHP] Database Administration

2010-09-24 Thread Tom Barrett
On 22 September 2010 21:40, Bastien Koert phps...@gmail.com 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

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) ani...@mail.com 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

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 php-gene...@garydjones.name 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

Re: [PHP] Re: Copying an Object

2010-09-24 Thread Peter Lind
On 24 September 2010 14:22, Bob McConnell r...@cbord.com wrote: From: David Hutto On Fri, Sep 24, 2010 at 4:09 AM, Gary php-gene...@garydjones.name 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 pre/pre tags to preserve formatting. whenever I do a print_r(), i also encapsulate it within a pre/pre tag so it is readable. on another note, when I use variables within double quotes (or even the heredoc

RE: [PHP] Re: Copying an Object

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

Re: [PHP] Re: Copying an Object

2010-09-24 Thread chris h
On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind peter.e.l...@gmail.com wrote: On 24 September 2010 14:22, Bob McConnell r...@cbord.com wrote: From: David Hutto On Fri, Sep 24, 2010 at 4:09 AM, Gary php-gene...@garydjones.name wrote: Daniel Kolbo wrote: Say you have two classes: human

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 peter.e.l...@gmail.com wrote: On 24 September 2010 14:22, Bob McConnell r...@cbord.com wrote: From: David Hutto On Fri, Sep 24, 2010 at 4:09 AM, Gary php-gene...@garydjones.name wrote: Daniel Kolbo

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 r...@cbord.com wrote: From: chris h On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind peter.e.l...@gmail.com

Re: [PHP] Database Administration

2010-09-24 Thread Andrew Ballard
On Fri, Sep 24, 2010 at 6:19 AM, Tom Barrett t...@miramedia.co.uk 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

Re: [PHP] Copying an Object

2010-09-24 Thread Nathan Nobbe
On Thu, Sep 23, 2010 at 12:24 AM, Peter Lind peter.e.l...@gmail.com wrote: On 23 September 2010 02:14, Daniel Kolbo kolb0...@umn.edu 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

[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

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 amckenz...@gmail.com wrote: Hey folks, Here's the deal. I have the following code:

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] 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 phps...@gmail.com 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

Re: [PHP] Database Administration

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

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 '

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']]) { echo

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

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

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

Re: [PHP] Database Administration

2010-09-24 Thread Bastien Koert
On Fri, Sep 24, 2010 at 2:26 PM, tedd tedd.sperl...@gmail.com 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

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 tedd
At 2:36 PM -0400 9/24/10, Bastien Koert wrote: On Fri, Sep 24, 2010 at 2:26 PM, tedd tedd.sperl...@gmail.com 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

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

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 tedd.sperl...@gmail.com 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

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: switch(1) {

Re: [PHP] Database Administration

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

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 you have a

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, you need an

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 test can dispatch all

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 to request of

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 r...@cbord.com wrote: From: David Hutto On Fri, Sep 24, 2010 at 4:09 AM, Gary php-gene...@garydjones.name wrote: Daniel Kolbo wrote: Say you have two classes: human