일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 월별 카운트
- mathemetica
- is_array
- Java
- SQL
- mysql
- selectc
- halliday
- function
- 점점변하는값
- PORTG
- cocos2d-x
- Post
- Avr
- Call
- array
- 0x
- unalias
- solution
- C++
- application.mk
- 단축키
- 하이퍼 터미널
- android studio
- Get
- Join
- 파일존재
- 현재언어
- 강좌
- php
- Today
- Total
목록컴퓨터 이야기/WEB (8)
코딩도사의 코드정리
셀렉터예시설명id, class, tag로 선택 ★★★*$("*")모든 요소들#id$("#lastname")id가 "lastname"인 요소.class$(".intro")클래스가 "intro"인 요소들.class,.class$(".intro,.demo")클래스가 "intro" 또는 "demo"인 요소들element$("p") 요소들el1,el2,el3$("h1,div,p"), and 요소들처음, 마지막, 홀수, 짝수 선택 ★ :first$("p:first")첫번째 요소 :last$("p:last")마지막 요소 :odd$("tr:odd")홀수번째 요소들 :even$("tr:even")짝수번째 요소들자식, 타입에 따른 선택 :first-child$("p:first-child")All elements that ..
// 정수에, 천자리 마다 쉼표 넣기 echo number_format(1234567890); echo number_format(123456789); echo number_format(12345678); echo number_format(1000); echo number_format(66); // 천자리 쉼표 넣기, 소수점 이하 2자리까지 echo number_format(1234567890.555555, 2); echo number_format(123456789.555555, 2); echo number_format(12345678.555555, 2); echo number_format(1000.555555, 2); echo number_format(66.555555, 2);
http://link/foo.php?id[]=1&id[]=2&id[]=3 // 배열 넘기기 http://link/foo.php?dic[a]=b&id[c]=d&id[e]=f // 사전형 넘기기.
select date_format(`reg_date`, '%Y-%m-%d') d, count(*) from table group by d; +------------+----------+ | d | count(*) | +------------+----------+ | 0000-00-00 | 6 | | 2015-11-15 | 2 | | 2015-12-21 | 3 | +------------+----------+ 3 rows in set (0.00 sec) 간단하게 월별 카운트 select date_format(`reg_date`, '%Y-%m') d, count(*) from table group by d; +---------+----------+ | d | count(*) | +---------+-----..
$db_conn = mysql_connect(SQL_HOSTNAME,SQL_ID,SQL_PASSWORD); if(!$db_conn){ echo "fail"; exit(); } if(!mysql_select_db(SQL_DBNAME,$db_conn)){ echo "fail"; exit(); } $sql = "select * from " . TABLE; $rs = mysql_query($sql,$db_conn); $resultArray = array(); while($row = mysql_fetch_assoc($rs)){ $resultArray[] = $row; } print_r($resultArray);
foreach는 배열을 처음부터 끝까지 배열 값을 이용하고 싶을 때 씀. Syntax foreach ($array as $value) { } $colors = array("red", "green", "blue", "yellow"); // 배열 생성 foreach ($colors as $value) { echo "$value "; } [결과] red green blue yellow
(PHP 4, PHP 5, PHP 7)is_array — 변수가 배열인지 확인설명 ¶bool is_array ( mixed $var )주어진 변수가 배열인지 확인합니다.