
TableDelete::execute 메서드의 WHERE 조건을 설정하는 방법은 다음과 같습니다.
#hostingforum.kr
php
$tableDelete = new TableDelete('테이블명');
$tableDelete->where('컬럼명', 'NULL');
$tableDelete->execute();
위 코드는 '테이블명' 테이블의 '컬럼명' 컬럼이 NULL 인 레코드를 삭제합니다.
또는 WHERE 조건을 여러 개 설정할 수도 있습니다.
#hostingforum.kr
php
$tableDelete = new TableDelete('테이블명');
$tableDelete->where('컬럼명1', 'NULL')
->where('컬럼명2', '값')
->execute();
위 코드는 '테이블명' 테이블의 '컬럼명1' 컬럼이 NULL 인 레코드와 '컬럼명2' 컬럼이 '값' 인 레코드를 삭제합니다.
WHERE 조건을 설정할 때는 where() 메서드를 사용하고, 조건을 여러 개 설정할 때는 where() 메서드를 연속적으로 호출합니다.
2025-03-23 09:17