PHP-Code:
<?php
function get_projekt() {
//global vars
global $tpl; //smarty
global $objDB; //pear
global $PHP_SELF;
global $QUERY_STRING;
global $prefix;
$sql= "SELECT
P.name, P.pid,
C.name
FROM
".$prefix."_projekt P
LEFT JOIN ".$prefix."_client C
ON C.cid = P.cid
WHERE
P.status = 0";
$result = $objDB->query($sql);
if(DB::isError($result)) {
die($result->getMessage());
}
$this->projektdata = array();
while($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {
$this->projektdata[] = $row;
}
echo "<hr><pre>";
print_r($this->projektdata);
echo "</pre><hr>";
//template
$tpl->assign('projektdata', $this->projektdata);
}
?>
Code:
<select name=select> {html_options values=$projektdata selected=$startselected output=$projektdata} </select>