250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- image
- 애니메이션
- ipad
- HTML
- xcode
- react
- 풀스택
- jQuery
- front-end
- html5
- MAC
- 백엔드
- iPhone
- Animation
- keyframes
- 개발자
- 자바스크립트
- SWIFT
- javascript
- hover
- iOS 개발자
- php
- effect
- css3
- button
- 비전공 개발자
- CSS
- 프론트엔드
- IOS
- 비전공자
Archives
- Today
- Total
비전공자 개발일기
FIND_IN_SET() 본문
728x90
SMALL
FIND_IN_SET() in MySQL
- Syntax: FIND_IN_SET(search string, string list)
- Example: FIND_IN_SET('ank', 'b,ank,of,monk')
$datas = "";
foreach ($data_info as $key => $value) {
$datas .= $value . ",";
}
- Example2:
SELECT * FROM client_contract WHERE FIND_IN_SET(idx,'{$datas}')-> client_contract 테이블에서 {$datas}라는 필드값에서 idx인 데이터만을 반환
- Result: 2
-> 특정 세트(ex 배열) 내에 있는 걸 찾는다는 의미로, 해당 string의 위치를 반환
-> 검색한 문자의 값이 없을 경우, 0을 반환
https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_find-in-set
https://www.w3resource.com/mysql/string-functions/mysql-find_in_set-function.php
728x90
LIST