Palantar
unread,Apr 30, 2008, 9:10:16 PM4/30/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Php Object Generator
Heyas Joel, just wondering - this looks like a bug to me, but
obviously you'll know better. in the POG base class, FetchObjects/
CreateObjects appears to be expecting the database query to return a
valid mysql_result, but it is returning the number of rows instead. I
get an error every time I use it.
The current database object looks like this:
public static function Query($query, $connection)
{
$result = mysql_query($query, $connection);
return mysql_num_rows($result);
}
the current FetchObject code (relevant portions) looks like this:
public function FetchObjects($query, $objectClass, $lazy = true)
{
$databaseConnection = Database::Connect();
$result = Database::Query($query, $databaseConnection);
$objectList = $this->CreateObjects($result, $objectClass, $lazy);
return $objectList;
}
private function CreateObjects($mysql_result, $objectClass, $lazyLoad
= true)
{
$objectList = array();
while ($row = mysql_fetch_assoc($mysql_result))
{
$pog_object = new $objectClass();
$this->PopulateObjectAttributes($row, $pog_object);
$objectList[] = $pog_object;
}
return $objectList;
}
Thanks for looking,
Tim