How to fill CCK SELECT BOX with PHP
Submitted by edex on Tue, 06/10/2008 - 06:49.
I found the lack of documentation also confusing (and time-consuming). You need to return an array like this:
$array["value"] = "label";
For instance:
<?php
$result = db_query(db_rewrite_sql('SELECT nid,title from {node} WHERE type="page"'));
while ($item = db_fetch_object($result)) {
$items[$item->nid] = $item->title;
}
return $items;
?>Source
Post new comment