$j_arr=array();
while(list($strCode,$strKorTitle) =$Ins_News_db_lib->db_view()) {
$strKorTitle=iconv("euckr","UTF-8",$strKorTitle); $d_array=array("code"=>"$strCode","title"=>"$strKorTitle"); array_push($j_arr,$d_array); }
print_r(urldecode(json_encode($j_arr)));
$("#strProgramCode option").remove(); $("#strProgramCode").append("<option value=''>프로그램 선택</option>"); $.ajax({type: "POST", url: "php_bin/mizy_program_input.php?d_mode=cate", data: "cate=" + $(this).val(), dataType: "json", success: function(responseText){ for(var i = 0; i < responseText.length; i++){ $("#strProgramCode").append("<option value='" + responseText[i].code + "'>" + responseText[i].title + "</option>"); } }, error: function(response){alert('error\n\n' + response.responseText);return false;} });
|