n レベルのカテゴリで選択ボックスを作成していますが、空白のレコードを取得しています エラーが見つかりませんでした 問題は何ですか。
$value = 'upload_files/';
echo $manage_folder->getFolderOptionListByParentId(0,$value);
function getFolderOptionListByParentId($parent = 0,$value)
{
$html = '';
$query = mysql_query("SELECT * from tbl_folder where folder_parent_id = '$parent'");
if($query){
while($row = mysql_fetch_assoc($query))
{
$current_id = $row['folder_id'];
$passvalue = $value.$row['folder_name'].'/';
$html .= '<option value="'.$passvalue.'">' . $value.$row['folder_name'].'/<option>';
$has_sub = NULL;
$has_sub = mysql_fetch_assoc(mysql_query("SELECT COUNT(folder_parent_id) as total FROM tbl_folder WHERE folder_parent_id = '$current_id'"));
if($has_sub['total'] != 0){
$html.= $this->getFolderOptionListByParentId($current_id,$passvalue);
}
}
}
return $html;
}
私の得る答えは以下のようなものです
<select name="file_upload_dir" class="select_uplopad">
<option value="upload_files/">upload_files/</option>
<option value="upload_files/eteste/">upload_files/eteste/</option>
<option></option>
<option value="upload_files/Munir_26/">upload_files/Munir_26/</option>
<option></option>
<option value="upload_files/Munir_26/munir1/">upload_files/Munir_26/munir1/</option>
<option></option>
<option value="upload_files/Munir_26/munir12/">upload_files/Munir_26/munir12/</option>
<option></option>
<option value="upload_files/Test_27/">upload_files/Test_27/</option><option></option> <option value="upload_files/Kaushik_28/">upload_files/Kaushik_28/</option>
<option></option><option value="upload_files/32_abhisekh/">upload_files/32_abhisekh/</option>
<option></option>
<option value="upload_files/Harigopal_33/">upload_files/Harigopal_33/</option><option></option>
<option value="upload_files/34_test/">upload_files/34_test/</option>
<option></option><option value="upload_files/34_test/dsds/">upload_files/34_test/dsds/</option>
<option>
</option>
</select>
私はこのタイプの結果を手に入れました。
私に与えてください