cubrid_error_code 함수는 API 실행 중 발생한 오류에 대한 오류 코드를 얻어온다. 일반적으로 API가 false를 반환했을 때 오류코드를 얻을 수 있다.
int cubrid_error_code ()
$req = cubrid_execute ($con, "select id, name from person");
if ($req) {
while (list ($id, $name) = cubrid_fetch($req))
echo $id, $name;
} else {
echo "Error Code: ", cubrid_error_code ();
echo "Error Facility: ", cubrid_error_code_facility ();
echo "Error Message: ", cubrid_error_msg ();
}