On Sat, October 14, 2006 5:18 pm, Kevin Waterson wrote:
class returnConfigParams
{
var $a;
function getMySQLParams()
{
include($_SERVER['DOCUMENT_ROOT']./properties.php);
$values = array(0 = $a, 1 = $b, 2 = $c, 3 = $d);
You probably want $this-a instead of $a
And that also
Richard Lynch wrote:
But I don't think you can even *DO* an include() inside a class
definition, so that should be giving you an error...
You can do an include/require anywhere. However, you cannot declare new
functions inside an include and use it to add methods or variables to a
class.
Hi,
If you have an array assigned to a variable, you access elements of it with
[].
$foo = array('a', 'b', 'c');
print $foo[0]; // gives 'a'
$bar = array('a' = 'hello', 'b' = 'world');
print $foo['b']; // gives 'world'
I know that.
I had my class written as:
On Sunday 15 October 2006 03:19, AR wrote:
Hi,
If you have an array assigned to a variable, you access elements of it
with [].
$foo = array('a', 'b', 'c');
print $foo[0]; // gives 'a'
$bar = array('a' = 'hello', 'b' = 'world');
print $foo['b']; // gives 'world'
I know that.
Hello,
Sorry for the newbie question :(
I have this class named returnConfigParams that returns an array
called $values through a function called getMySQLParams().
My question is how to retrieve the values of the array from the file
that calls the class.
I have:
$params_file = New
# [EMAIL PROTECTED] / 2006-10-14 15:55:57 +0100:
Hello,
Sorry for the newbie question :(
I have this class named returnConfigParams that returns an array
called $values through a function called getMySQLParams().
My question is how to retrieve the values of the array from the file
that
Hello,
I have this class named returnConfigParams that returns an array
called $values through a function called getMySQLParams().
My question is how to retrieve the values of the array from the file
that calls the class.
I have:
$params_file = New returnConfigParams;
# [EMAIL PROTECTED] / 2006-10-14 16:28:57 +0100:
Hello,
I have this class named returnConfigParams that returns an array
called $values through a function called getMySQLParams().
My question is how to retrieve the values of the array from the file
that calls the class.
I have:
Hello,
Just like you'd access members of any other array.
$whatever = $params_file-getMySQLParams();
print($whatever[0]);
This is a matter of basic rules of the language. Did you know
most of the grammer is described in the manual?
Sure, i already tried that, but it
# [EMAIL PROTECTED] / 2006-10-14 16:42:37 +0100:
Just like you'd access members of any other array.
$whatever = $params_file-getMySQLParams();
print($whatever[0]);
This is a matter of basic rules of the language. Did you know
most of the grammer is described in
This one time, at band camp, Roman Neuhauser wrote:
BTW, here is my class:
class returnConfigParams
{
var $a;
var $b;
var $c;
var $d;
function getMySQLParams()
{
include($_SERVER['DOCUMENT_ROOT']./properties.php);
$values = array(0 = $a, 1 = $b, 2 = $c, 3 =
Hello,
I've rewritten my class as you told me:
--
class returnConfigParams
{
private static $instance = NULL;
var $a;
var $b;
var $c;
var $d;
private function __construct() {
}
// function that get the database
On Saturday 14 October 2006 19:09, AR wrote:
Hello,
I've rewritten my class as you told me:
--
class returnConfigParams
{
private static $instance = NULL;
var $a;
var $b;
var $c;
var $d;
private function
13 matches
Mail list logo