469,955 Members | 2,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

Use of variables in classes

I've written a simple class that puts together a MySQL SELECT query and
allows you to extend the query, but I'm unsure as to when to use $this - >
var_name and when I can just use $varname, and when it's necessary to use
'var $varname' and when this can be left out.
Here's the class - could it be made simpler?
Michael

class select_query_builder {
// class to put together and add to a select query
var $query;
var $select;
var $from;
var $where;
var $orderby;
var $distinct;
var $t_select;
var $t_from;
var $t_where;
var $t_orderby;

function select_query_builder($select, $from, $where='', $orderby ='') {
// each variable is an array

$this -> select = $select;
$this -> from = $from;
$this -> where = $where;
$this -> orderby = $orderby;

$this -> t_select = $select;
$this -> t_from = $from;
$this -> t_where = $where;
$this -> t_orderby = $orderby;
}

// add additional elements to the query
function extend_query($what, $newinfo)
{
$this -> {'t_'.$what} = array_merge($this -> {'t_'.$what}, $newinfo);
}

// return the complete query;
function return_query() {
$this -> query = 'SELECT '$this -> distinct.' '.implode(', ', $this ->
t_select).' FROM '.implode(', ', $this -> t_from);

if (!empty($this -> t_where)) {
$this -> query .= ' WHERE '.implode(' AND ', $this -> t_where);
}

if (!empty($this -> orderby)) {
$this -> query .= ' ORDER BY '.implode(' ASC, ', $this -> t_orderby).'
ASC';
}

return $this -> query;

}

function reset_to_before_extend() {

$this -> t_select = $this -> select;
$this -> t_from = $this -> from;
$this -> t_where = $this -> where;
$this -> t_orderby = $this -> orderby;
}
}
Jul 17 '05 #1
15 1900
Take a look at http://www.tonymarston.co.uk/php-mys...seobjects.html
for some tips on this subject.

--
Tony Marston

http://www.tonymarston.net
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@hercules.btinternet.com...
I've written a simple class that puts together a MySQL SELECT query and
allows you to extend the query, but I'm unsure as to when to use $this - >
var_name and when I can just use $varname, and when it's necessary to use
'var $varname' and when this can be left out.
Here's the class - could it be made simpler?
Michael

class select_query_builder {
// class to put together and add to a select query
var $query;
var $select;
var $from;
var $where;
var $orderby;
var $distinct;
var $t_select;
var $t_from;
var $t_where;
var $t_orderby;

function select_query_builder($select, $from, $where='', $orderby ='') {
// each variable is an array

$this -> select = $select;
$this -> from = $from;
$this -> where = $where;
$this -> orderby = $orderby;

$this -> t_select = $select;
$this -> t_from = $from;
$this -> t_where = $where;
$this -> t_orderby = $orderby;
}

// add additional elements to the query
function extend_query($what, $newinfo)
{
$this -> {'t_'.$what} = array_merge($this -> {'t_'.$what}, $newinfo);
}

// return the complete query;
function return_query() {
$this -> query = 'SELECT '$this -> distinct.' '.implode(', ', $this ->
t_select).' FROM '.implode(', ', $this -> t_from);

if (!empty($this -> t_where)) {
$this -> query .= ' WHERE '.implode(' AND ', $this -> t_where);
}

if (!empty($this -> orderby)) {
$this -> query .= ' ORDER BY '.implode(' ASC, ', $this -> t_orderby).'
ASC';
}

return $this -> query;

}

function reset_to_before_extend() {

$this -> t_select = $this -> select;
$this -> t_from = $this -> from;
$this -> t_where = $this -> where;
$this -> t_orderby = $this -> orderby;
}
}

Jul 17 '05 #2
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@hercules.btinternet.com...
I've written a simple class that puts together a MySQL SELECT query and
allows you to extend the query, but I'm unsure as to when to use $this - >
var_name and when I can just use $varname, and when it's necessary to use
'var $varname' and when this can be left out.
Here's the class - could it be made simpler?
Michael


Why would you want to do that though? The whole point of declarative
languages like SQL is to avoid the kind of complex code that you're writing.
Jul 17 '05 #3
I have a form which allows people to search a database of tutorials by any
combination of location, tutor, subject or date.
Using this class I can set a number of columns, tables and 'WHERE' clauses
that re-occur in every possible search when I initiate the class, then
simply add to the query as necesary for each possible search criteria
combination. Although in terms of code the class is more complex than a
series of conditional statements, by abstracting it, it makes it the code on
the page much easier to understand and therefore easier and quicker to
update.
"Chung Leong" <ch***********@hotmail.com> wrote in message
news:Hp********************@comcast.com...
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@hercules.btinternet.com...
I've written a simple class that puts together a MySQL SELECT query and
allows you to extend the query, but I'm unsure as to when to use $this -
var_name and when I can just use $varname, and when it's necessary to use 'var $varname' and when this can be left out.
Here's the class - could it be made simpler?
Michael


Why would you want to do that though? The whole point of declarative
languages like SQL is to avoid the kind of complex code that you're

writing.

Jul 17 '05 #4
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@sparta.btinternet.com...
I have a form which allows people to search a database of tutorials by any
combination of location, tutor, subject or date.
Using this class I can set a number of columns, tables and 'WHERE' clauses
that re-occur in every possible search when I initiate the class, then
simply add to the query as necesary for each possible search criteria
combination. Although in terms of code the class is more complex than a
series of conditional statements, by abstracting it, it makes it the code on the page much easier to understand and therefore easier and quicker to
update.


Abstraction would mean that the calling code isn't aware of the underlying
storage mechanism. This is clearly not the case here. All you have is a
class that limits what kind of query you can build.
Jul 17 '05 #5
Good point. Clearly I did not explain myself very well.
I don't see what you are getting at though - Are you suggesting that there
is a way to generate multiple related query statements just using SQL?
Michael

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:TJ********************@comcast.com...
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@sparta.btinternet.com...
I have a form which allows people to search a database of tutorials by any combination of location, tutor, subject or date.
Using this class I can set a number of columns, tables and 'WHERE' clauses that re-occur in every possible search when I initiate the class, then
simply add to the query as necesary for each possible search criteria
combination. Although in terms of code the class is more complex than a
series of conditional statements, by abstracting it, it makes it the
code on
the page much easier to understand and therefore easier and quicker to
update.


Abstraction would mean that the calling code isn't aware of the underlying
storage mechanism. This is clearly not the case here. All you have is a
class that limits what kind of query you can build.

Jul 17 '05 #6
Dear Tony,
Thanks - Useful advice.
Michael

"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message
news:c8*******************@news.demon.co.uk...
Take a look at http://www.tonymarston.co.uk/php-mys...seobjects.html
for some tips on this subject.

--
Tony Marston

http://www.tonymarston.net
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@hercules.btinternet.com...
I've written a simple class that puts together a MySQL SELECT query and
allows you to extend the query, but I'm unsure as to when to use $this -

var_name and when I can just use $varname, and when it's necessary to use 'var $varname' and when this can be left out.
Here's the class - could it be made simpler?
Michael

class select_query_builder {
// class to put together and add to a select query
var $query;
var $select;
var $from;
var $where;
var $orderby;
var $distinct;
var $t_select;
var $t_from;
var $t_where;
var $t_orderby;

function select_query_builder($select, $from, $where='', $orderby ='') {
// each variable is an array

$this -> select = $select;
$this -> from = $from;
$this -> where = $where;
$this -> orderby = $orderby;

$this -> t_select = $select;
$this -> t_from = $from;
$this -> t_where = $where;
$this -> t_orderby = $orderby;
}

// add additional elements to the query
function extend_query($what, $newinfo)
{
$this -> {'t_'.$what} = array_merge($this -> {'t_'.$what}, $newinfo);
}

// return the complete query;
function return_query() {
$this -> query = 'SELECT '$this -> distinct.' '.implode(', ', $this ->
t_select).' FROM '.implode(', ', $this -> t_from);

if (!empty($this -> t_where)) {
$this -> query .= ' WHERE '.implode(' AND ', $this -> t_where);
}

if (!empty($this -> orderby)) {
$this -> query .= ' ORDER BY '.implode(' ASC, ', $this -> t_orderby).'
ASC';
}

return $this -> query;

}

function reset_to_before_extend() {

$this -> t_select = $this -> select;
$this -> t_from = $this -> from;
$this -> t_where = $this -> where;
$this -> t_orderby = $this -> orderby;
}
}


Jul 17 '05 #7

"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@sparta.btinternet.com...
Good point. Clearly I did not explain myself very well.
I don't see what you are getting at though - Are you suggesting that there
is a way to generate multiple related query statements just using SQL?
Michael


All I'm saying you don't need a class to build a SQL statement.
Jul 17 '05 #8
You may be right - it works for me though - I wouldn't use it if I was just
building one query statement, but for a series of related statements, it
looks a lot better than, for example, the code below which was what
persuaded me to write a class when faced with a similar problem to solve for
another client - in my opinion interspersing lots of conditional statements
is a messy solution compared to the relative 'cleanness' of code that you
can get by using a class. I appreciate that using a class will actually mean
that the code will take longer to run than the example below, but I
personally I'm happy to accept a slight loss of speed if it means that the
code is easy to read and update.
$query = "SELECT ev.prd_id, UNIX_TIMESTAMP(date_start) AS date_start,
UNIX_TIMESTAMP(date_end) AS date_end, evd.eve_name, evd.eve_name2,
evd.eve_des_x, t.tut_name, t.tut_url, v.ven_name, ev.ctc_id, ctc.ctc_name,
v.ven_id, v.ven_town, v.ven_url, co.country_name, prc.price_unitcost,
prd.prd_forsale, dt.date_more_x, tl.tut_priority, tl.tut_more_x";

if ($pi) {$query .= ', dsc.eve_description';}

$query .= " FROM n_event ev, n_eventdetails evd, n_date dt, n_tutor t,
n_tutorlist tl, n_venue v, n_country co, n_price prc, n_product prd,
n_contacts ctc";

if ($sbj) {$query .= ', n_event_subject esbj';}

if ($pi) {$query .= ', n_eventdescription dsc';}

$query .= " WHERE prd.cat_id=1 AND prd.prd_id = ev.prd_id AND evd.eve_id =
ev.eve_id AND dt.prd_id = ev.prd_id AND tl.prd_id = ev.prd_id AND t.tut_id =
tl.tut_id AND v.ven_id = ev.ven_id AND co.country_id = v.country_id AND
prc.price_id = prd.price_id AND ev.ctc_id = ctc.ctc_id AND dt.date_priority
= 1 ";

if ((!$isildur) && (!$tpi)) { $query.=' AND UNIX_TIMESTAMP(date_end) >
(UNIX_TIMESTAMP(now())-86400) '; }

if ($tpi) { $query .= ' AND prd.prd_id = '.$tpi.' '; }
else {$query .= ' AND prd.prd_forsale = 1 ';}

if ($t) $query .= ' AND tl.tut_id ='.$t.' ';
else $query .= ' AND tl.tut_priority = 1';

if ($pi) $query .= ' AND dsc.eve_id = ev.eve_id';
Jul 17 '05 #9
And exactly how you wouldn't need if statement if you use the class? All it
does is implode the conditions together, which is perfectly doable without
the use of a class.

$conds[] = ($tpi) ? "prd.prd_id = $tpi" : "prd.prd_forsale = 1";
$conds[] = ($t) ? "tl.tut_id = $t" : "tl.tut_priority = 1";
$conds[] = ($pi) ? "dsc.eve_id = ev.eve_id" : null;
....
implode(" AND ", array_filter($conds));

The point I'm trying to make is that you're encapsulating at the wrong
level. Imploding a bunch of strings and attaching "AND" and "WHERE" is easy
stuff. The complexity is in the logic of the query not its syntax.
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@hercules.btinternet.com...
You may be right - it works for me though - I wouldn't use it if I was just building one query statement, but for a series of related statements, it
looks a lot better than, for example, the code below which was what
persuaded me to write a class when faced with a similar problem to solve for another client - in my opinion interspersing lots of conditional statements is a messy solution compared to the relative 'cleanness' of code that you
can get by using a class. I appreciate that using a class will actually mean that the code will take longer to run than the example below, but I
personally I'm happy to accept a slight loss of speed if it means that the
code is easy to read and update.
$query = "SELECT ev.prd_id, UNIX_TIMESTAMP(date_start) AS date_start,
UNIX_TIMESTAMP(date_end) AS date_end, evd.eve_name, evd.eve_name2,
evd.eve_des_x, t.tut_name, t.tut_url, v.ven_name, ev.ctc_id, ctc.ctc_name,
v.ven_id, v.ven_town, v.ven_url, co.country_name, prc.price_unitcost,
prd.prd_forsale, dt.date_more_x, tl.tut_priority, tl.tut_more_x";

if ($pi) {$query .= ', dsc.eve_description';}

$query .= " FROM n_event ev, n_eventdetails evd, n_date dt, n_tutor t,
n_tutorlist tl, n_venue v, n_country co, n_price prc, n_product prd,
n_contacts ctc";

if ($sbj) {$query .= ', n_event_subject esbj';}

if ($pi) {$query .= ', n_eventdescription dsc';}

$query .= " WHERE prd.cat_id=1 AND prd.prd_id = ev.prd_id AND evd.eve_id =
ev.eve_id AND dt.prd_id = ev.prd_id AND tl.prd_id = ev.prd_id AND t.tut_id = tl.tut_id AND v.ven_id = ev.ven_id AND co.country_id = v.country_id AND
prc.price_id = prd.price_id AND ev.ctc_id = ctc.ctc_id AND dt.date_priority = 1 ";

if ((!$isildur) && (!$tpi)) { $query.=' AND UNIX_TIMESTAMP(date_end) >
(UNIX_TIMESTAMP(now())-86400) '; }

if ($tpi) { $query .= ' AND prd.prd_id = '.$tpi.' '; }
else {$query .= ' AND prd.prd_forsale = 1 ';}

if ($t) $query .= ' AND tl.tut_id ='.$t.' ';
else $query .= ' AND tl.tut_priority = 1';

if ($pi) $query .= ' AND dsc.eve_id = ev.eve_id';

Jul 17 '05 #10
Well, to be honest I did not mean to suggest that I would not need if
statements, only that I would not need to have them interspersed in quite
such a messy way. What you've written does look very clean, so I have to
concede that using a class for this is overkill!
Sadly, I'm still not much wiser about the use of variables in classes. You
wouldn't happen to know anything about them would you?
Michael

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:UK********************@comcast.com...
And exactly how you wouldn't need if statement if you use the class? All it does is implode the conditions together, which is perfectly doable without
the use of a class.

$conds[] = ($tpi) ? "prd.prd_id = $tpi" : "prd.prd_forsale = 1";
$conds[] = ($t) ? "tl.tut_id = $t" : "tl.tut_priority = 1";
$conds[] = ($pi) ? "dsc.eve_id = ev.eve_id" : null;
...
implode(" AND ", array_filter($conds));

The point I'm trying to make is that you're encapsulating at the wrong
level. Imploding a bunch of strings and attaching "AND" and "WHERE" is easy stuff. The complexity is in the logic of the query not its syntax.
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@hercules.btinternet.com...
You may be right - it works for me though - I wouldn't use it if I was just
building one query statement, but for a series of related statements, it
looks a lot better than, for example, the code below which was what
persuaded me to write a class when faced with a similar problem to solve

for
another client - in my opinion interspersing lots of conditional

statements
is a messy solution compared to the relative 'cleanness' of code that you can get by using a class. I appreciate that using a class will actually

mean
that the code will take longer to run than the example below, but I
personally I'm happy to accept a slight loss of speed if it means that the code is easy to read and update.
$query = "SELECT ev.prd_id, UNIX_TIMESTAMP(date_start) AS date_start,
UNIX_TIMESTAMP(date_end) AS date_end, evd.eve_name, evd.eve_name2,
evd.eve_des_x, t.tut_name, t.tut_url, v.ven_name, ev.ctc_id, ctc.ctc_name, v.ven_id, v.ven_town, v.ven_url, co.country_name, prc.price_unitcost,
prd.prd_forsale, dt.date_more_x, tl.tut_priority, tl.tut_more_x";

if ($pi) {$query .= ', dsc.eve_description';}

$query .= " FROM n_event ev, n_eventdetails evd, n_date dt, n_tutor t,
n_tutorlist tl, n_venue v, n_country co, n_price prc, n_product prd,
n_contacts ctc";

if ($sbj) {$query .= ', n_event_subject esbj';}

if ($pi) {$query .= ', n_eventdescription dsc';}

$query .= " WHERE prd.cat_id=1 AND prd.prd_id = ev.prd_id AND evd.eve_id = ev.eve_id AND dt.prd_id = ev.prd_id AND tl.prd_id = ev.prd_id AND t.tut_id =
tl.tut_id AND v.ven_id = ev.ven_id AND co.country_id = v.country_id

AND prc.price_id = prd.price_id AND ev.ctc_id = ctc.ctc_id AND

dt.date_priority
= 1 ";

if ((!$isildur) && (!$tpi)) { $query.=' AND UNIX_TIMESTAMP(date_end) >
(UNIX_TIMESTAMP(now())-86400) '; }

if ($tpi) { $query .= ' AND prd.prd_id = '.$tpi.' '; }
else {$query .= ' AND prd.prd_forsale = 1 ';}

if ($t) $query .= ' AND tl.tut_id ='.$t.' ';
else $query .= ' AND tl.tut_priority = 1';

if ($pi) $query .= ' AND dsc.eve_id = ev.eve_id';


Jul 17 '05 #11
The goal is to write code that is clear, not just looks clean.

Doing with variables in classes is fairly simple: you have to use $this->
all the time.

"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@hercules.btinternet.com...
Well, to be honest I did not mean to suggest that I would not need if
statements, only that I would not need to have them interspersed in quite
such a messy way. What you've written does look very clean, so I have to
concede that using a class for this is overkill!
Sadly, I'm still not much wiser about the use of variables in classes. You
wouldn't happen to know anything about them would you?
Michael

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:UK********************@comcast.com...
And exactly how you wouldn't need if statement if you use the class? All it
does is implode the conditions together, which is perfectly doable without
the use of a class.

$conds[] = ($tpi) ? "prd.prd_id = $tpi" : "prd.prd_forsale = 1";
$conds[] = ($t) ? "tl.tut_id = $t" : "tl.tut_priority = 1";
$conds[] = ($pi) ? "dsc.eve_id = ev.eve_id" : null;
...
implode(" AND ", array_filter($conds));

The point I'm trying to make is that you're encapsulating at the wrong
level. Imploding a bunch of strings and attaching "AND" and "WHERE" is

easy
stuff. The complexity is in the logic of the query not its syntax.
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@hercules.btinternet.com...
You may be right - it works for me though - I wouldn't use it if I was

just
building one query statement, but for a series of related statements, it looks a lot better than, for example, the code below which was what
persuaded me to write a class when faced with a similar problem to
solve for
another client - in my opinion interspersing lots of conditional

statements
is a messy solution compared to the relative 'cleanness' of code that you can get by using a class. I appreciate that using a class will
actually mean
that the code will take longer to run than the example below, but I
personally I'm happy to accept a slight loss of speed if it means that

the code is easy to read and update.
$query = "SELECT ev.prd_id, UNIX_TIMESTAMP(date_start) AS date_start,
UNIX_TIMESTAMP(date_end) AS date_end, evd.eve_name, evd.eve_name2,
evd.eve_des_x, t.tut_name, t.tut_url, v.ven_name, ev.ctc_id, ctc.ctc_name, v.ven_id, v.ven_town, v.ven_url, co.country_name, prc.price_unitcost,
prd.prd_forsale, dt.date_more_x, tl.tut_priority, tl.tut_more_x";

if ($pi) {$query .= ', dsc.eve_description';}

$query .= " FROM n_event ev, n_eventdetails evd, n_date dt, n_tutor t,
n_tutorlist tl, n_venue v, n_country co, n_price prc, n_product prd,
n_contacts ctc";

if ($sbj) {$query .= ', n_event_subject esbj';}

if ($pi) {$query .= ', n_eventdescription dsc';}

$query .= " WHERE prd.cat_id=1 AND prd.prd_id = ev.prd_id AND
evd.eve_id = ev.eve_id AND dt.prd_id = ev.prd_id AND tl.prd_id = ev.prd_id AND t.tut_id
=
tl.tut_id AND v.ven_id = ev.ven_id AND co.country_id = v.country_id

AND prc.price_id = prd.price_id AND ev.ctc_id = ctc.ctc_id AND

dt.date_priority
= 1 ";

if ((!$isildur) && (!$tpi)) { $query.=' AND UNIX_TIMESTAMP(date_end) (UNIX_TIMESTAMP(now())-86400) '; }

if ($tpi) { $query .= ' AND prd.prd_id = '.$tpi.' '; }
else {$query .= ' AND prd.prd_forsale = 1 ';}

if ($t) $query .= ' AND tl.tut_id ='.$t.' ';
else $query .= ' AND tl.tut_priority = 1';

if ($pi) $query .= ' AND dsc.eve_id = ev.eve_id';



Jul 17 '05 #12
> Doing with variables in classes is fairly simple: you have to use $this->
all the time.


That's one of the parts I'm confused about - clearly there are a lot of
instances
where variables are refered to just using $varname rather than $this ->
varname
within classes.
Michael
Jul 17 '05 #13
If you refer to $varname within a class method then that variable is local
only to that method.

If you refer to $this->varname then that variable is global to any method
within the class.

--
Tony Marston
http://www.tonymarston.net
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@sparta.btinternet.com...
Doing with variables in classes is fairly simple: you have to use $this-> all the time.


That's one of the parts I'm confused about - clearly there are a lot of
instances
where variables are refered to just using $varname rather than $this ->
varname
within classes.
Michael

Jul 17 '05 #14
Thanks Tony. I'm sure I'm being a bit thick here. I've only just started
attempting to write classes and I'm not sure why I'm finding them so
difficult.
Do you only declare with 'var = $varname' if it's a variable that you need
to have as a global within the class?
Mike

"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message
news:c8*******************@news.demon.co.uk...
If you refer to $varname within a class method then that variable is local
only to that method.

If you refer to $this->varname then that variable is global to any method
within the class.

--
Tony Marston
http://www.tonymarston.net
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@sparta.btinternet.com...
Doing with variables in classes is fairly simple: you have to use $this-> all the time.


That's one of the parts I'm confused about - clearly there are a lot of
instances
where variables are refered to just using $varname rather than $this ->
varname
within classes.
Michael


Jul 17 '05 #15
No. Just var $varname;
Take a look at http://www.tonymarston.co.uk/php-mys...seobjects.html
for a brief desciption on how to use classes in PHP.

--
Tony Marston

http://www.tonymarston.net
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@titan.btinternet.com...
Thanks Tony. I'm sure I'm being a bit thick here. I've only just started
attempting to write classes and I'm not sure why I'm finding them so
difficult.
Do you only declare with 'var = $varname' if it's a variable that you need
to have as a global within the class?
Mike

"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message
news:c8*******************@news.demon.co.uk...
If you refer to $varname within a class method then that variable is local only to that method.

If you refer to $this->varname then that variable is global to any method within the class.

--
Tony Marston
http://www.tonymarston.net
"Michael" <le*****@britishlibrary.net> wrote in message
news:c8**********@sparta.btinternet.com...
> Doing with variables in classes is fairly simple: you have to use

$this->
> all the time.

That's one of the parts I'm confused about - clearly there are a lot of instances
where variables are refered to just using $varname rather than $this -> varname
within classes.
Michael



Jul 17 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by BCC | last post: by
4 posts views Thread by Brad Kartchner | last post: by
4 posts views Thread by Bryan Green | last post: by
9 posts views Thread by Justin Voelker | last post: by
20 posts views Thread by tshad | last post: by
2 posts views Thread by Nikolaus Rath | last post: by
17 posts views Thread by Juha Nieminen | last post: by
1 post views Thread by xamalek | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.