Hi All,
Need help by filling SELECT Box.
The problem is the data won't appear in the selectbox. It won't work. The data is in a database.
Thanks in advance
TanTrazz
Need help by filling SELECT Box.
The problem is the data won't appear in the selectbox. It won't work. The data is in a database.
Code:
//Database Connectie
$conn = odbc_connect('ims',"","") or die("Couldn't connect to datasource.");
//dropdown
$onderwerp = "SELECT Message_Subject_Id, Name_Long FROM CODE_MESSAGE_SUBJECTS";
//num_rows select box
function better_odbc_num($conn,$onderwerp){
$result = odbc_exec($conn,$onderwerp);
$count=0;
while($temp = odbc_fetch_into($result, &$counter)){
$count++;
}
return $count;
}
<td align = left>
<select name=onderwerp>
<?
if(better_odbc_num($conn,$onderwerp))
{
while($x=odbc_fetch_row($onderwerp))
{
print("<option value = {$x[0]} >{$x[1]}</option>");
}
}
?>
</select>
Thanks in advance
TanTrazz