On Thu, Jul 16, 2009 at 9:53 AM, Govinda wrote:
>
> On Jul 15, 2009, at 3:28 PM, tedd wrote:
>
>> My way -- every time I open a database, I do so by including the
>> configuration.php file that holds the logon/password et other data to
>> connect with the database. When I'm done with what I want fr
On Jul 15, 2009, at 3:28 PM, tedd wrote:
My way -- every time I open a database, I do so by including the
configuration.php file that holds the logon/password et other data
to connect with the database. When I'm done with what I want from
the database, I close it.
If one does not close i
At 12:21 PM +0200 7/14/09, Anton Heuschen wrote:
In my index.php page I then use $dbconnect again but do I simply use
$dbconnect again ... or must I say global $dbconnect and then use it in the
rest of the DB calls? or use GLOBALS ..
Anton:
My way -- every time I open a database, I do so
do you need to use global?
IMO you should use just 1 global variable, thats is what I call "entry point"
My scripts looks like...
require_once 'loader.php';
Loader::registerAutoload();
$foo = new Foo();
$foo->doStuff();
This way you can develop faster and do maintenance better avoiding
problems
> Oh and if one class uses methods in another class do I instansiate a
> new object of the other class I have seen use of OtherClass::Method
> is this better method of $obj = new OtherClass() use
The :: is used to access static methods of a class. Static methods can
be used withou
On Tue, Jul 14, 2009 at 6:21 AM, Anton Heuschen wrote:
> This is just a general question,
>
> I am not 100% on when to use global $var , and $this->var and how/what
> about the GLOBAL vars
>
> Lets say I have one file I call config.php here I connect to the db, to
> ldap etc the con
Define a class function and pass the array via this function or pass it
via the classes constructor.
VamVan wrote:
Hello Guys,
I have a problem here. I hope you can help me resolving it.
Please see the code below
array.php has $array1 = ('hello'=>'heelo',)
require_once('array.php');
class
VamVan wrote:
Hello Guys,
I have a problem here. I hope you can help me resolving it.
Please see the code below
array.php has $array1 = ('hello'=>'heelo',)
require_once('array.php');
class Classa {
}
How can I access the array values in my class? I want to understand the
scope.
You can't
On Wed, April 18, 2007 5:33 pm, Yvan Strahm wrote:
> I have this function:
>
> function preg_array($pattern, $array, $r_array)
> {
> global $match;
> global $r_array;
Passing in $r_array *AND* declaring it global is just plain silly.
Do one or the other, but not both.
If the array is L
Robert Cummings wrote:
To answer his question though, variables not declared via the "global"
keyword and not accessed via the super global variables ($GLOBALS,
$_SESSION, etc) inherit the scope in which the include statement occurs.
Therefore, if in the included file all you have is:
$foo =
On Thu, 2007-01-18 at 10:29 -0500, tedd wrote:
> At 9:49 PM -0800 1/17/07, jekillen wrote:
> >Hello php list:
> >If I include a php script inside a php function definition and then call the
> >function in another script. What is the scope of variables in the included
> >script? Are they local to th
At 9:49 PM -0800 1/17/07, jekillen wrote:
Hello php list:
If I include a php script inside a php function definition and then call the
function in another script. What is the scope of variables in the included
script? Are they local to the function that calls include with the file name?
Thanks in
# [EMAIL PROTECTED] / 2007-01-17 21:49:05 -0800:
> Hello php list:
> If I include a php script inside a php function definition and then
> call the function in another script. What is the scope of variables in
> the included script? Are they local to the function that calls include
> with the file
On 1/17/07, Andrew Kreps <[EMAIL PROTECTED]> wrote:
On 1/17/07, jekillen <[EMAIL PROTECTED]> wrote:
> Hello php list:
> If I include a php script inside a php function definition and then
> call the
> function in another script. What is the scope of variables in the
> included
> script? Are they
On 1/17/07, jekillen <[EMAIL PROTECTED]> wrote:
Hello php list:
If I include a php script inside a php function definition and then
call the
function in another script. What is the scope of variables in the
included
script? Are they local to the function that calls include with the file
name?
Tha
Stuart Bailey wrote:
Hi
I'm developing an app to administer LDAP (phpLdapAdmin is too complex for the
customer).
I have created an LDAP class, in a file class_ldap.php. It include methods for
connecting to the server, binding a DN (effectively login), and adding posix
groups.
I have an index
GH wrote:
> Hi I am having an issue with I think it is the scope of variables:
>
> I have a file that I am including which has the following"
>
> // +--
> // | PHP Source
> // +-
> In my main file, I am attempting to from with in a function
> call $language['project_name'] and i am failing... can you
> offer any advice?
>
Are there any specific reasons that you need to set the variable to global
scope?
It's typically recommended that unless you need to, to pass the va
List
Subject: Re: [PHP] scope problem
Hello Larry,
Friday, March 5, 2004, 4:01:39 PM, you wrote:
LB> This gives values something to the tune of...
LB> 200
LB> 400
LB> 700
LB> 100
Hard to say with so little code, but...
Your first where loop is probably running twice, i.e. res
Hello Larry,
Friday, March 5, 2004, 4:01:39 PM, you wrote:
LB> This gives values something to the tune of...
LB> 200
LB> 400
LB> 700
LB> 100
Hard to say with so little code, but...
Your first where loop is probably running twice, i.e. resetting
variable back to 100 after the 2nd (internal) wh
If anyone read this post, you probably already forgot about it, but I
just wanted to clarify that I found the source of the problem and it was
a coding mistake on my part, not a problem with PHP's array
implementation.
Erik
On Thursday, June 6, 2002, at 03:11 PM, Erik Price wrote:
> Hi
Whoops, you're right. Classic 'C' mistake using = instead of ==. Never mind
:(
> On Mon, 2002-03-11 at 18:51, Randall Perry wrote:
>> According to the PHP 4 docs all variables are global unless within a
>> function. I've got the following test code which should output 2, but
>> outputs 1. The whi
I may be wrong, but that's exactly what I ended up having to do... but
don't quote me - I'm just learning OOP
http://www.apokalyptik.com/forum/viewtopic.php?topic=140&forum=6&0
-Original Message-
From: Randall Perry [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 6:52 PM
To: [EM
On Mon, 2002-03-11 at 18:51, Randall Perry wrote:
> According to the PHP 4 docs all variables are global unless within a
> function. I've got the following test code which should output 2, but
> outputs 1. The while loop creates it's own class object (which seems strange
> since it isn't explicitl
On Friday 16 February 2001 04:19, Maxim Maletsky wrote:
> It will escape the error ... or better say you force the function to
> always return true.
[...]
> $where = @where($user);
>
> this will always return true no matter what happen
Bullshit (sorry. I just *had* to say this :). From the manual
It will escape the error ... or better say you force the function to always
return true.
Very useful if you don't really care whether you succeed or not.
Like during user tracking, you don't want to exit the script only because
something went wrong while you were curious where did he come from,
On Wednesday 14 February 2001 17:36, Karl J. Stubsjoen wrote:
> When you @ "at" a command (supress error messaging) within a function,
> is the scope of the @ within the function?
>
> Example:
>
>
> CloseODBC(1);
>
> # is error message supressed here too?
>
>
> function CloseODBC($connection_id)
>
My understanding is, it simple supress the any messages generated from
the result. So I guess it is local.
Karl J. Stubsjoen wrote:
> When you @ "at" a command (supress error messaging) within a function, is
> the scope of the @ within the function?
>
> Example:
>
>
> CloseODBC(1);
>
> # is
28 matches
Mail list logo