셀렉트에서 날짜를 선택하면 바로 그 해당 데이터가 보이게끔 하고싶습니다. 채택완료
기존에는 달력이 나오면서
function ok_ttt(_year, _month){
document.getElementsByName("toYear")[0].value = _year;
document.getElementsByName("toMonth")[0].value = _month;
//alert($('input[name="toYear"]').val());
document.ft.submit();
}
//연도계산처리하기
$_year_l = $year;
$_month_l = $month-1;
$_year_r = $year;
$_month_r = $month+1;
if((int)$month==1){
$_year_l = (int)$year-1;
$_month_l = 12;
}else if((int)$month==12){
$_year_r = (int)$year+1;
$_month_r = 1;
}
$year1 = substr($date['today'],0,4);
$month1 = substr($date['today'],4,2);
$day1 = substr($date['today'],6,2);
$hour1 = 0;
$year2 = substr($date['today'],0,4);
$month2 = substr($date['today'],4,2);
$day2 = substr($date['today'],6,2);
$hour2 = 23;
?>
이 스크립트를 이용하여
=$year?>년 =$month?>월
이렇게 가운데 2017년 8월 이라는 숫자가 나오고 양옆에 < > 화살표가 나와서
마우스를 클릭하면 전월이나 다음달로 이동할 수 있게끔 해놓은 상태였습니다.
제가 하고싶은 기능은
셀렉트로 날짜를 나오게끔 하고
예를들어 2017년 5월을 클릭하면 자동으로 그해의 데이터가 나오게끔 하고 싶은데요
우선 소스는 이러한 상태이고
2015년을 먼저 선택하고 8월을 선택하면 그때 바로 그 해당 월로 넘어가서 데이터가 나오게 하고싶습니다
그게 어려우면 따로 검색버튼을 만들어서 해야하는지 그것도 궁금합니다.
답변 1개
php를 이용하여 mysql 데이터를 출력하는 것을 모르시나요?
selectbox에 onChange를 이용하면 값이 변경되었을 때 이벤트를 사용할 수 있어요
function dataprint(obj){
document.location.href = "주소";
}
이 정도는 알고 있을 듯한데요
그누보드를 사용하고 있다면
$que = "select * from {$g5['member_table']}";
$res = sql_query( $que );
while( $row = sql_fetch_array( $res )) {
echo $row['mb_id'];
}
이것이 기본적으로 php와 mysql을 연동하여 데이터를 출력하는 구문이에요.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인