Skip site navigation (1) Skip section navigation (2)

Some Questions

From: Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com>
To: PostgreSQL-PHP Mailing List <pgsql-php(at)postgresql(dot)org>
Subject: Some Questions
Date: 2003-06-12 12:05:02
Message-ID: 20030612120502.63422.qmail@web80507.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-php
Hi:

   I have a question on calling a method in PHP.

suppose I have file class1.php which contains class1
<?
  class class1{
      var $a1;

      function class1()
      {
        $this->a1 = "hello";
      }

      function t1()
      {
          return $this->a1;
      } 
  }
?>
in test.php I have the ff:
<?
    include("class1.php");
    $obj = new class1();
    $a = "test";

    die("this is $a message=$obj->t1()");
?>

    The message displayed is always:
        this is test message=()
    instead of :
        this is test message=hello

  is there another way of doing it aside from:
  $x = $obj->t1();
  die("this is $a message=$x");


Thanks in advance,
ludwig lim
    

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Responses

pgsql-php by date

Next:From: Ludwig LimDate: 2003-06-12 12:05:21
Subject: A question on method calling in PHP
Previous:From: KurtDate: 2003-06-10 22:27:05
Subject: Groups

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group