전체보기

    [MSSQL] IDENTITY값 초기화

    보통 PK 값으로 사용하는 항목은 자동증가(auto_increment ; identity) 로 지정하는 경우가 많습니다.테스트용으로 데이타를 넣고 삭제하다 보면 지정된 시작번호(예를 들면, 1) 부터 나오지 않게 됩니다.이것을 서버에서 그 번호를 관리하고 있기 때문입니다.사실 반드시 1번부터 시작하지 않아도 상관은 없는데 굳이 1부터 나오도록 하고자하는 욕심이 있습니다.그럴 경우 다음처럼 하시면 됩니다.1. 일단 모든 데이타를 삭제합니다.2. 쿼리창에서 다음의 쿼리문을 작성하고 실행시킵니다.DBCC CHECKIDENT( [table_name] , RESEED, 0 )예를 들어 테이블명이 member 라면DBCC CHECKIDENT( member , RESEED, 0 )--> 다음부터는 insert 로 들..

    엑셀 다운로드 구현 시 한글 깨짐 문제

    이렇게 하니까 안 깨진다 ㅎㅎ header("Content-type: application/vnd.ms-excel; charset=euc-kr");header("Content-Description: PHP4 Generated Data");header("Content-Disposition: attachment; filename=$title_name.$file_name.xls");print("");

    Fatal error: Allowed memory size of 8388608 bytes exgausted ...

    php파일을 실행 중에 아래와 같은 오류가 발생하는 경우가 있다. Fatal error: Allowed memory size of 8388608 bytes exgausted ... 나의 경우엔 게시판에서 첨부파일을 업로드해서 사용하는 경우에 발생했다. 원인 : php.ini에서 설정한 메모리의 크기보다 php파일 실행시 사용하는 메모리가 더 크기 때문 해결방법1. php.ini파일을 열어서 memory_limit값을 수정 (기본값은 아래의 이미지와 같이 8M 또는 16M로 설정되어있음)-> 단점 : 첨부파일을 사이즈마다 값을 수정해야할 수 있음 2. 에러가 발생하는 php파일에서

    php 세팅 [Undefined variable] 문제

    에러표시가 안될 경우 : display_errors Off --> On Notice: Undefined variable...이렇게 변수들 마다 에러가 발생하는데 이경우 php.ini error_reporting = E_ALL --> error_reporting = E_ALL & ~E_NOTICE 로 변경

    new php trim() 에러 처리 방법

    new php and warnings: trim() expects parameter 1 to be string => if (is_string($value) { $nvalue = trim($value); }

    IDE 넷빈즈 자주쓰는 단축키

    코드템플릿 : 코드 자동 완성 기능 psvm + space키 -> public static void main(String[] args) sout + space키 -> System.out.println(""); 넷빈즈 5.5 - tab 넷빈즈 6.0 - space --------------------------------------------------- Ctrl + Shift + C = 주석시작 커서가 검은 네모 칸일때는 insert키를 누름 ctrl + / = 해당라인 주석처리 shift + alt + f = 코드 자동 들여쓰기 정렬 --------------------------------------------------- 윈도우 관련 Alt+화살표 좌,우 = 탭윈도우에서 좌 우로 이동 Ctrl + ..

    Enter키 폼 전송 막기

    $(function() { $("input:text").keydown(function(evt) { if (evt.keyCode == 13) return false; }); }); 아래 방법이 익스플로어에서는 동작하지 않는다. 역시 jQuery가 간단하구나;;; 태그 내부에 둘러싸여진 input text 박스에서 포커스가 있을 때 Enter 를 누르게 되면 자동으로 submit 이 된다. 이것은 form 내부에 input 박스가 하나만 존재해서 그렇다. 이 기능을 막고자 한다면 여러가지 방법이 있는데 그에 대한 방법들을 설명하고자 한다. (1) keycode 값을 판단해서 처리 form 이 submit 되었을때 javascript 로 keycode 값을 읽어와 Enter 에 해당하는 것들은 스킵하게 해준다..

    jquery 간단한 정리

    1. jQuery로 선택된 값 읽기 $("#selectBoxoption:selected").val();$("select[name=name]").val(); 2. jQuery로 선택된 내용 읽기 $("#selectBoxoption:selected").text(); 3. 선택된 위치 var index =$("#test option").index($("#test option:selected")); 4. Addoptions to the end of a select $("#selectBox").append("Apples");$("#selectBox").append("After Apples"); 5. Addoptions to the start of a select $("#selectBox").prepend("Bef..

    MySQL Problem ERROR 2005 (HY000): Unknown MySQL server host ‘localhost’ (0)

    The problem occurred after you installed window7:1ERROR 2005 (HY000): Unknown MySQL server host 'localhost' (0)I was able to solve this problem by modifying my list of hostnames:1C:\Windows\System32\drivers\etc\hostsMake sure that you have the following entry:1127.0.0.1 localhostThis ensures that the host “localhost” resolves to the IP address 127.0.0.1.