2022-05-13 12:10:57 날짜 데이터 형식에 12일 1달 3달 6달 더하려면 어떻게 해야할까요??

2022-05-13 12:10:57 날짜 데이터 형식에 12일 1달 3달 6달 더하려면 어떻게 해야할까요??

QA

2022-05-13 12:10:57 날짜 데이터 형식에 12일 1달 3달 6달 더하려면 어떻게 해야할까요??

본문

2022-05-13 12:10:57 날짜 데이터 형식에 12일 1달 3달 6달 더하려면 어떻게 해야할까요??

 

G5_TIME_YMDHIS 이값에 12일 더한 값  1달 3달 6달 더해야하거든요 어떻게 하면 좋을까요??

이 질문에 댓글 쓰기 :

답변 1

https://extbrain.tistory.com/29

참고하세요.

$sumpoint=(int)$member[mb_point]-(int)$_POST[point];

if((int)$_POST[point]=="9800"){
$timestamp = strtotime("+12 days");
$timestamp2=date("Y-m-d H:i:s", $timestamp);


$enddate=$_POST[enddate]+$timestamp2;
}else if((int)$_POST[point]=="19800"){
$timestamp = strtotime("+1 months");
$timestamp2=date("Y-m-d H:i:s", $timestamp);


$enddate=$_POST[enddate]+$timestamp2;

}else if((int)$_POST[point]=="45800"){
$timestamp = strtotime("+3 months");
$timestamp2=date("Y-m-d H:i:s", $timestamp);


$enddate=$_POST[enddate]+$timestamp2;
}else if((int)$_POST[point]=="79800"){
$timestamp = strtotime("+6 months");
$timestamp2=date("Y-m-d H:i:s", $timestamp);


$enddate=$_POST[enddate]+$timestamp2;

}else{

}

if($_POST[point] <= $member[mb_point]){
echo $sql = " update $g5[member_table] set mb_point='$sumpoint', mb_7='$_POST[startdate]', mb_8='$enddate' where mb_id='$member[mb_id]'";

//exit;
$row = sql_query($sql);
mysql_error();
//die( "mysql connect error : " . mysql_error() );
//exit;
}else{
alert("포인트를 충전하세요");
}

참고했는데 값이 4040 이렇게 합쳐지네요

답변을 작성하시기 전에 로그인 해주세요.
전체 445
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT