cubrid_prepare()로 데이타 입력시 질문입니다.

by 지니보이 posted Dec 16, 2009
아래와 같이 값을 바인딩 할 때 넘어온 값이 NULL일 경우나 "" 일 경우가
있는 필드는 다 이런식으로 하나하나 분기문으로 해줘야 하나요?

아니면 자동으로 값이 없으면 처리해주는 방법이 있나요

$count_qry = "select * from DB명 where code = ?";
$req = cubrid_prepare($con, $count_qry);

if($MCAT) {
$res = cubrid_bind($req, 3, $MCAT, "NUMERIC");
} else {
$res = cubrid_bind($req, 3, $MCAT, "NULL");
}

$result = cubrid_execute($req);

Articles

15 16 17 18 19 20 21 22 23 24