Re: [PHP] uh oh, I defined a resoruce

2008-01-14 Thread Nathan Nobbe
On Jan 14, 2008 6:11 PM, Sancar Saran <[EMAIL PROTECTED]> wrote: > Hello Jochem, > > > > no not in the slightest. both those bits of code are identical for one > > (apart from the fact that neither are valid syntax). and whatever your > > trying to point out it's beside the point (I think). any po

Re: [PHP] uh oh, I defined a resoruce

2008-01-14 Thread Sancar Saran
Hello Jochem, > > no not in the slightest. both those bits of code are identical for one > (apart from the fact that neither are valid syntax). and whatever your > trying to point out it's beside the point (I think). any possible race > condition will be occuring with the code that *sets* data into

Re: [PHP] uh oh, I defined a resoruce

2008-01-14 Thread Jochem Maas
Sancar Saran schreef: On Sunday 13 January 2008 21:42:28 Jochem Maas wrote: no race conditions occur in code written in php? true that there is no direct race conditions that can occur as a direct result of running code but obviously you've never dealt with multi-user systems using a databse bac

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Sancar Saran
On Sunday 13 January 2008 21:42:28 Jochem Maas wrote: > > no race conditions occur in code written in php? true that there is > no direct race conditions that can occur as a direct result of running code > but obviously you've never dealt with multi-user systems using a databse > backend, or file-w

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Jochem Maas
Sancar Saran schreef: On Sunday 13 January 2008 16:53:42 Jochem Maas wrote: Sancar Saran schreef: Well, ADODB and TYPO3 are successfull oss procjecs which uses PHP and they utilizes globals at large. windows is a successful OS but most people would agree it's built on a foundation of cruft.

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Sancar Saran
On Sunday 13 January 2008 16:53:42 Jochem Maas wrote: > Sancar Saran schreef: > > Well, > > > > ADODB and TYPO3 are successfull oss procjecs which uses PHP and they > > utilizes globals at large. > > windows is a successful OS but most people would agree it's built on a > foundation of cruft. > >

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Nathan Nobbe
On Jan 13, 2008 12:14 PM, David Giragosian <[EMAIL PROTECTED]> wrote: > In general, I agree with Stut's response delineated earlier in this > thread, > that a careful and circumscribed use of globals has a place in PHP > programming. agreed. -nathan

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread David Giragosian
On 1/13/08, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > > the 2 problems that globals introduce are > >1. namespace collisions >2. point of origin problem > > where a namespace collision is the inconsistent use of a global > variable within an application > eg. > // one point in the applicat

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Nathan Nobbe
the 2 problems that globals introduce are 1. namespace collisions 2. point of origin problem where a namespace collision is the inconsistent use of a global variable within an application eg. // one point in the application $GLOBALS['curUser'] = array('username' => 'bob', 'userId' => 5);

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread David Giragosian
On 1/13/08, Naz Gassiep <[EMAIL PROTECTED]> wrote: > > > >> While "global variables are good" in quotes did not return any results > >> from Google, "global variables are evil" in quotes only returned a > result > >> set of 4: > >> > >> Results *1* - *4* of *4* for *" global< > http://www.google.co

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Naz Gassiep
While "global variables are good" in quotes did not return any results from Google, "global variables are evil" in quotes only returned a result set of 4: Results *1* - *4* of *4* for *" global

Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Jochem Maas
Sancar Saran schreef: Well, ADODB and TYPO3 are successfull oss procjecs which uses PHP and they utilizes globals at large. windows is a successful OS but most people would agree it's built on a foundation of cruft. success != built with good code != globals are good practice. Regards.

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Sancar Saran
Well, ADODB and TYPO3 are successfull oss procjecs which uses PHP and they utilizes globals at large. Regards. Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Eric Butera
On Jan 10, 2008 4:41 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Eric Butera schreef: > > On Jan 10, 2008 4:00 PM, Stut <[EMAIL PROTECTED]> wrote: > >> Eric Butera wrote: > >>> Haha. Thank you for all that insightful research. Seriously though, > >>> using globals you might already be in hell!

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Jochem Maas
Eric Butera schreef: On Jan 10, 2008 4:00 PM, Stut <[EMAIL PROTECTED]> wrote: Eric Butera wrote: Haha. Thank you for all that insightful research. Seriously though, using globals you might already be in hell! =\ IMHO global variables are evil in the same way that register_globals were. Desp

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Eric Butera
On Jan 10, 2008 4:00 PM, Stut <[EMAIL PROTECTED]> wrote: > Eric Butera wrote: > > Haha. Thank you for all that insightful research. Seriously though, > > using globals you might already be in hell! =\ > > IMHO global variables are evil in the same way that register_globals > were. Despite everyt

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Stut
Eric Butera wrote: Haha. Thank you for all that insightful research. Seriously though, using globals you might already be in hell! =\ IMHO global variables are evil in the same way that register_globals were. Despite everything you've probably heard it is actually possible to create a secu

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Eric Butera
On Jan 10, 2008 3:34 PM, David Giragosian <[EMAIL PROTECTED]> wrote: > > > On 1/10/08, David Giragosian <[EMAIL PROTECTED]> wrote: > > > > > > On 1/10/08, Eric Butera <[EMAIL PROTECTED] > wrote: > > > On Jan 10, 2008 2:28 PM, David Giragosian < [EMAIL PROTECTED] > > wrote: > > > > > > > > On 1/10/0

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread David Giragosian
On 1/10/08, David Giragosian <[EMAIL PROTECTED]> wrote: > > On 1/10/08, Eric Butera <[EMAIL PROTECTED]> wrote: > > > > On Jan 10, 2008 2:28 PM, David Giragosian <[EMAIL PROTECTED] > > > wrote: > > > > > > On 1/10/08, Eric Butera <[EMAIL PROTECTED]> wrote: > > > > > > > > On Jan 10, 2008 2:02 PM, P

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread David Giragosian
On 1/10/08, Eric Butera <[EMAIL PROTECTED]> wrote: > > On Jan 10, 2008 2:28 PM, David Giragosian <[EMAIL PROTECTED]> wrote: > > > > On 1/10/08, Eric Butera <[EMAIL PROTECTED]> wrote: > > > > > > On Jan 10, 2008 2:02 PM, Philip Thompson <[EMAIL PROTECTED]> > wrote: > > > > On Jan 10, 2008, at 12:48

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Eric Butera
On Jan 10, 2008 2:28 PM, David Giragosian <[EMAIL PROTECTED]> wrote: > > On 1/10/08, Eric Butera <[EMAIL PROTECTED]> wrote: > > > > On Jan 10, 2008 2:02 PM, Philip Thompson <[EMAIL PROTECTED]> wrote: > > > On Jan 10, 2008, at 12:48 PM, Eric Butera wrote: > > > > > > > On Jan 10, 2008 1:33 PM, <[EM

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread David Giragosian
On 1/10/08, Eric Butera <[EMAIL PROTECTED]> wrote: > > On Jan 10, 2008 2:02 PM, Philip Thompson <[EMAIL PROTECTED]> wrote: > > On Jan 10, 2008, at 12:48 PM, Eric Butera wrote: > > > > > On Jan 10, 2008 1:33 PM, <[EMAIL PROTECTED]> wrote: > > >> I have been using define to create a constant for the

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Eric Butera
On Jan 10, 2008 2:02 PM, Philip Thompson <[EMAIL PROTECTED]> wrote: > On Jan 10, 2008, at 12:48 PM, Eric Butera wrote: > > > On Jan 10, 2008 1:33 PM, <[EMAIL PROTECTED]> wrote: > >> I have been using define to create a constant for the link resource > >> returned by mysql > >> pconnect like so: >

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Philip Thompson
On Jan 10, 2008, at 12:48 PM, Eric Butera wrote: On Jan 10, 2008 1:33 PM, <[EMAIL PROTECTED]> wrote: I have been using define to create a constant for the link resource returned by mysql pconnect like so: $PL = @mysql_pconnect("localhost", $DBUser, $DBPass); define("SITE_DB",$PL); Later I

Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Eric Butera
On Jan 10, 2008 1:33 PM, <[EMAIL PROTECTED]> wrote: > I have been using define to create a constant for the link resource returned > by mysql > pconnect like so: > > $PL = @mysql_pconnect("localhost", $DBUser, $DBPass); > define("SITE_DB",$PL); > > > Later I use the constant to select my database

[PHP] uh oh, I defined a resoruce

2008-01-10 Thread reese
I have been using define to create a constant for the link resource returned by mysql pconnect like so: $PL = @mysql_pconnect("localhost", $DBUser, $DBPass); define("SITE_DB",$PL); Later I use the constant to select my databases. mysql_select_db($SrcdbID ,SITE_DB); This code