Background Image

FORUM

조회 수 14220 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

안녕하세요...
큐브리드를 통해 php로 프로그램을 만들고 있습니다..

만드는 중에 궁금한 게 있어서 질문 드립니다.
엑셀에서 받은 데이타값을 DB에 넣으려고 하는데요

1. auto increment 로 증가되는 키 값을 제외하곤 전부 INSERT를 하는데요
    이런 경우 필드 명 생략이 불가능 한지

 $sql = "insert into sgspocis (필드명, ... 필드명) values (?, ... ?)";

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

 $sql = "insert into sgspocis values (?, ... ?)";


2. 데이타를 받아와서 루프문으로 돌리게 되는데
    데이타 중에는 Char 값도 있고 Integer 값도 있습니다.
    이런 경우 Char 값에는 싱글 쿼테이션 처리를 해야 되지만
    Integer의 경우 싱글 쿼테이션이 있으면 에러가 나지 않습니까..
    이런 경우 어떤 방법으로 구별을 해주면 되나요


<?
 $sql = "insert into sgspocis (필드명, ... 필드명) values (?, ... ?)";

 $req = cubrid_prepare( $con, $sql, CUBRID_INCLUDE_OID );

 while ( $array = fgetcsv($line, 1000, ",") ) {
    for ($j = 0; $j < count($array)-1; $j++) {
     $res = cubrid_bind( $req, $j + 1, $array[$j]);
    }
  $res = cubrid_execute( $req );
}
?>

  • ?
    Prototype 2009.11.12 01:09
    1번의 경우는 생략 불가능하며..
    2번의 경우는 속성의 타입에 관계없이 무조건 STRING 형으로 바인딩 하시면 됩니다.
    $res = cubrid_bind( $req, $j + 1, $array[$j], "STRING");

  1. CUBRID 사용자를 위한 DBeaver 도구 출시 안내

    Date2024.04.23 Byadmin Views110
    read more
  2. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4473
    read more
  3. broker shard 추가시 proxy오류

    Date2014.06.26 By석이 Views9452
    Read More
  4. broker error

    Date2014.02.26 By쪼로롱 Views10502
    Read More
  5. blob select

    Date2023.04.05 By네오랜덤 Views141
    Read More
  6. bit형 데이터타입 관련

    Date2012.01.27 By소라게 Views10671
    Read More
  7. bin 폴더 안에 PDB 확장자 파일들 문의

    Date2014.09.01 By종이 Views8031
    Read More
  8. backupdb 실행 문의

    Date2021.03.02 ByJB Views206
    Read More
  9. backupdb 문의드립니다,

    Date2020.02.05 By동동 Views175
    Read More
  10. autoset 631 에서 창에서 큐브리드 매니저 실행시 다음과같은 에러창이 뜸

    Date2014.02.03 By아프리카 Views7756
    Read More
  11. autoexecquery.conf 파일 수정문의

    Date2021.04.29 By대청 Views133
    Read More
  12. autoexecquery.conf 매시간 실행 스케쥴 문의

    Date2022.04.06 ByRoy Views55
    Read More
  13. autocommit 설정

    Date2013.01.03 By바람바람 Views5357
    Read More
  14. autocommit 관련

    Date2011.12.15 By깨진질그릇조각인형 Views15590
    Read More
  15. autocommit off 방법 문의

    Date2010.06.08 By소라게 Views15706
    Read More
  16. auto_increment 추가 방법 문의

    Date2023.04.14 By부패방지운영팀 Views265
    Read More
  17. auto_increment 가 7.1 에서는 사용이 되지 않나요?

    Date2009.08.03 By메이커스 Views9727
    Read More
  18. auto_increament 추가와 브로커관련 문의드립니다.

    Date2016.03.23 By카이군 Views8189
    Read More
  19. auto increment 사용시 Insert 문제

    Date2009.11.11 By지니보이 Views14220
    Read More
  20. auto commit 이 되어있어서 잘못 update 처리한 데이터가 commit 되었을 때 대처법 부탁드립니다

    Date2023.07.21 Byrollback Views86
    Read More
  21. auto commit

    Date2022.01.20 Byairporti Views130
    Read More
  22. audit 기능에 대해 질문 드립니다.

    Date2014.02.27 By캬캬캬 Views7420
    Read More
Board Pagination Prev 1 ... 135 136 137 138 139 140 141 142 143 144 ... 200 Next
/ 200

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales