On Tue, April 11, 2006 6:40 am, Merlin wrote:
>>> The following code:
>>> class search_helper extends AjaxACApplication
>>> {
>>> var $db_username;
>>> $this->db_username = $DB_LOGIN;
A 'var' is a 'property' of a Class instance.
It needs to be inside the class, but
On Tue, April 11, 2006 3:14 am, Merlin wrote:
> This does not work:
>
> $this->db_username = $DB_login;
>
> Any idas on how to do this?
Since how you do this is how you did it, you're going to have to show
us the exact code you did that "does not work" because what you typed
above DOES WORK...
--
If you are using PHP4, you could always
class foo {
var $var1;
var $var2;
var $var3;
function bar(){
echo $this->var1."";
echo $this->var2."";
echo $this->var3."";
}
}
then in your code
$foo = new foo();
$foo->var1 = 'blah';
$foo->var2 = 'blah';
$foo->var3 = 'blah';
$foo->bar();
Merlin wrote:
chris smith schrieb:
On 4/11/06, Merlin <[EMAIL PROTECTED]> wrote:
chris smith schrieb:
On 4/11/06, Merlin <[EMAIL PROTECTED]> wrote:
Hi there,
no much simpler. I do not need to assign the value from outside
the class. This
is just inside the class. I have the login dat
chris smith schrieb:
On 4/11/06, Merlin <[EMAIL PROTECTED]> wrote:
chris smith schrieb:
On 4/11/06, Merlin <[EMAIL PROTECTED]> wrote:
Hi there,
no much simpler. I do not need to assign the value from outside the class. This
is just inside the class. I have the login data for a database saved
On 4/11/06, Merlin <[EMAIL PROTECTED]> wrote:
> chris smith schrieb:
> > On 4/11/06, Merlin <[EMAIL PROTECTED]> wrote:
> >> Hi there,
> >>
> >> no much simpler. I do not need to assign the value from outside the class.
> >> This
> >> is just inside the class. I have the login data for a database s
chris smith schrieb:
On 4/11/06, Merlin <[EMAIL PROTECTED]> wrote:
Hi there,
no much simpler. I do not need to assign the value from outside the class. This
is just inside the class. I have the login data for a database saved in a file
and would like to use simply the variable $DB_login inside
On 4/11/06, Merlin <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> no much simpler. I do not need to assign the value from outside the class.
> This
> is just inside the class. I have the login data for a database saved in a file
> and would like to use simply the variable $DB_login inside this class.
Hi there,
no much simpler. I do not need to assign the value from outside the class. This
is just inside the class. I have the login data for a database saved in a file
and would like to use simply the variable $DB_login inside this class.
This does not work:
$this->db_username = $DB_login;
use a setter function. Direct var assignments must be simple constants. A
setter function enforces encapsulation.
On 10/04/06, Merlin <[EMAIL PROTECTED]> wrote:
>
>
> Hi there,
>
> I would like to assign a value inside a class like this:
>
> var $db_username = $old_name;
>
> Unfortunatelly this do
How about this:
class foo {
var $name;
function setName($value) {
$this->name = $value;
}
}
-B
Merlin wrote:
Hi there,
I would like to assign a value inside a class like this:
var $db_username = $old_name;
Unfortunatelly this does not work and I do get following error:
Par
Hi there,
I would like to assign a value inside a class like this:
var $db_username = $old_name;
Unfortunatelly this does not work and I do get following error:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or
T_FUNCTION or T_VAR or '}'
Thank you for any hint on
12 matches
Mail list logo