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 |
Tags
- 개발자
- react
- css3
- button
- MAC
- xcode
- jQuery
- 애니메이션
- CSS
- effect
- hover
- 프론트엔드
- front-end
- html5
- php
- SWIFT
- 자바스크립트
- 비전공자
- iPhone
- IOS
- HTML
- iOS 개발자
- image
- 백엔드
- 풀스택
- Animation
- keyframes
- 비전공 개발자
- ipad
- javascript
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