Re: class problem :(

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 28, 2009 at 4:28 PM, Luke <luke@xxxxxxxxxxxxxx> wrote:

> Any ideas? Perhaps there is a different way I could implement the classes -
> I would rather not have getObjectIds repeated three times!


just make the classes instance-based, thats your easiest bet.
(sorry for the extra noise)

abstract class ForumObject
{
  private $table;

 function getObjectIds ($field, $value)
 {
 $query = "SELECT id FROM {$this->table} WHERE $field = '$value'";
 $object_ids = mysql_fetch_array();
 return $object_ids;
 }
}

painful, i know..  which is why static inheritance is one of the headliners
in 5.3.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux