odbc_fetch_row
odbc_num_rows
odbc_fetch_array
odbc_num_fields
please note: I have no trouble with gaining access to the Database and submitting odbc_exec commands.
Code: Select all
function createMenu($table,$value=NULL){
$query="SELECT * FROM $table";
$db_link=openDatabase();
$result=odbc_exec($db_link,$query)or die(print odbc_errormsg());
$count=recordCount($result);
$html[]="<select name='$table' id='$table'>";
if($count>0){
while(odbc_fetch_row($result)){
$type_name=odbc_result($result,'type_name');
$abbr=odbc_result($result,'abbr');
$selected="";
if($value==$abbr){
$selected="selected";
}
$html[]="<option value='$abbr' $selected>$type_name</option>";
}
$html[]="</select>";
$output=join("\n",$html);
print $output;
}
odbc_close($db_link);
}Thanks for any help!