2 messages in com.mysql.lists.eventum-userscustom fields from DB queries
FromSent OnAttachments
Barry Benowitz24 Jan 2006 08:20 
Morris24 Jan 2006 19:17 
Subject:custom fields from DB queries
From:Barry Benowitz (barr@raritan.com)
Date:01/24/2006 08:20:10 AM
List:com.mysql.lists.eventum-users

Hi all,

I have a custom field where the options are to come from a new table that I have created, so I am using extending my custom field class from the dynamic back end class that is provided. In my class I override the getList function where I do a DB query and I pass the result back. Here is the code.

function getList()

{

$stmt = "SELECT

build

FROM

" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "product_build_number

ORDER BY

build";

$res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);

if (PEAR::isError($res)) {

Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);

return "";

}

return $res;

}

But I get a strange looking dropdown. I assume that the return from the select is the wrong format for the drop-down list. How can I massage the return to get it to the right format?

Thanks,

Barry

Barry Benowitz

Raritan Computer

(732) 764 8886 x1362