본문 바로가기

Web Program/Php Lecture21

오라클 연동 데이타 불러오기 $conn = OCILogon('user', 'secret', 'DB'); $th = 0; // Table Header       $query = 'select * from PAYMENT';       $stid = OCIParse($conn, $query);       OCIExecute($stid);        echo "\n\n";        while (OCIFetchInto($stid, $row, OCI_ASSOC)) {          if (!$th) {            $keys = (array_keys($row));            echo "\n\n";            foreach ($keys as $k) {echo "" . $k . "\n";}            ec.. 2008. 9. 8.
파일 관련 함수 목록 basename -- 경로명에서 파일이름만 반환합니다 chgrp -- 파일의 그룹을 변환합니다 chmod -- 파일의 모드 변경 chown -- 파일의 소유자 변경 clearstatcache -- 파일의 통계(stat) 캐시를 삭제합니다. copy -- 파일을 복사합니다 delete -- 실제로는 없는 명령 dirname -- 경로의 구성요소중에서 디렉토리 이름만 반환합니다. disk_free_space -- Returns available space in directory disk_total_space -- Returns the total size of a directory diskfreespace -- 디렉토리의 사용가능한 공간을 반환합니다. fclose -- 열려있는 파일 포인터를 닫습니다. feo.. 2008. 9. 8.
날짜 연산 함수 function fnc_date_calc($this_date,$num_days){ $my_time = strtotime ($this_date); //converts date string to UNIX timestamp $timestamp = $my_time + ($num_days * 86400); //calculates # of days passed ($num_days) * # seconds in a day (86400) $return_date = date("Y/m/d",$timestamp); //puts the UNIX timestamp back into string format return $return_date;//exit function and return string }//end of funct.. 2008. 9. 8.
날짜 연산 $date22 = 20070214; $daterr = date("Ymd", strtotime("$date22 +1 day")); => 20070215 $daterr = date("Ymd", strtotime("$date22 + 2 days")); => 20070216 $daterr = date("Ymd", strtotime($date22) + 86400); 2008. 9. 8.