-
sql where 구문만들기PHP 2020. 7. 15. 09:55
$where = array(); if(! empty($field)) { $where[] = " field < ".$field. ""; } $sql = "SELECT * FROM table " ; if(count($where)) { $sql .= " WHERE ".implode( " AND ", $where); } 방식2 $where[] = array( "field" => "aaaa", "value" => "%aaaa%", "compare" => "LIKE");
'PHP' 카테고리의 다른 글
문자열 나누기 (0) 2020.07.15 배열 if문 checed (0) 2020.07.15 레코드 중복 그룹출력 (0) 2020.07.15 에러 리포팅 안보이기 (0) 2020.07.15 배열 정열하기 (0) 2020.07.15