날짜간 쿼리 검색
Server Side/PHP2015. 3. 14. 15:34
$sql = "select name, in_date from 테이블명 where status = 'Y' and
date_format(in_date, '%Y-%m-%d') between '2011-01-01' and '2014-12-31'";
$result = mysql_query($sql);
while($print = mysql_fetch_array($result)){
$explode_dates = $print['in_date'];
$contents = explode(" ",$explode_dates);
echo $print['name'] . $contents[0] . "<br />";
}
'Server Side > PHP' 카테고리의 다른 글
특정 회원의 지정일 합산해서 출력 (0) | 2015.05.09 |
---|---|
문자열 잘라서 배열로 반환하기 (0) | 2015.04.20 |
변수 안에 조건문 담는 3항 연산자 (0) | 2015.03.11 |
PHP 디버깅이 필요할 때 (0) | 2014.12.24 |
POST / GET / REQUEST 으로 페이지 넘겨 받기 (0) | 2014.12.01 |