truncate table '테이블명' 쿼리문 질문입니다. 채택완료
DSLOVE
8년 전
조회 4,021
안녕하세요.
매주 월요일마다 리셋시키는 테이블이 있는데,
예를들어 test_board 라는 테이블명이구요.
phpmyadmin 에 접속해서 돌리면 되는데, 외부에 잇을때는 못하는경우가 생겨서
php 파일로 만들어서 실행시켜서 하는 방법을 연구해보았는데요.
검색을 통해서 보니까
</p><p> </p><p><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><? </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);">include_once("./_common.php"); </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);">if ($is_admin == "super") { </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"> </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"> sql_query("TRUNCATE TABLE test_board"); </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"> } </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"> echo "리셋 완료!"; </span><br style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);">?> </span> </p><p><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);"> </span></p><p><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(252, 253, 254);">
이렇게 파일 만들어서 실행시키면 될까요?
직접해보기엔 아직 리셋날이 아니라서.. 송구스럽지만 질문글 통해서
답변 얻어보려고 등록하게 되었습니다.
감사합니다.^^
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인
헝그리 퍼블리셔네요 ㅠㅠ
다시 한번 답변 감사합니다 ^^