CI 묻고 답하기

제목 Default값이 한글로 되어 있어서 값이 안불러지는거 같습니다.
글쓴이 sjalove 작성시각 2013/11/19 14:39:31
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 13178   RSS
컨트롤러

$total_count_S = $this->Community->list_count("DB2",$table_name,array('state' => '처리완료'), "","");
 
모델


 function list_count($dbname, $table_name, $sql_where, $searchkey, $searchvalue) {
 
  $this->$dbname->select(' COUNT('.$this->$dbname->protect_identifiers('*').') as '.$this->$dbname->protect_identifiers('cnt'));

  if ($sql_where!="") 
   $this->$dbname->where($sql_where);  <-- 이부분
 
  if ($searchvalue != "" && $searchvalue != "NULL")
   $this->$dbname->like( $searchkey, $searchvalue);

  $qry = $this->$dbname->get($table_name);
  $row = $qry->row();

  $this->$dbname->flush_cache();
  //$this->$dbname->close(); 

  return $row->cnt;
 }

연관배열 방법으로 

array('state' => '처리완료')

로 해서 (state는 컬럼값   처리완료는 디폴트값입니다.)

모델로 보내서 where 처리 했습니다.

그러니깐 state가 처리완료값만 있는것을 몇개있냐 숫자로 뽐아내는것인데요

이와 똑같은 방식인 디폴트값이 영어인것은 잘되는데

아마 이번것은 디폴트값이 한글로 되어있어서 안불러져있는거 같네요.ㅠ.ㅠ

해답 부탁드립니다 ㅠ,.ㅠ















 다음글 ci에서 보통 스타일과 자스는 어디에 ? (5)
 이전글 DB Insert시 에러 핸들링 방법? (1)

댓글

변종원(웅파) / 2013/11/19 21:23:49 / 추천 0
db에 들어있는 한글 캐릭터셋과 컨트롤러의 캐릭터셋을 비교해보세요.

양쪽이 다르면 당연히 데이터를 못가져올 수 있습니다.