0
어떻게하면됩니까?질의 결과, codeigniter 및 postgresql 나누기
모델 페이지$query = $this->db->query("SELECT masters from table2 where table_id='table2-G' AND psced_id='58'");
//masters in an Integer type
if ($query !=0){
//code for dividing
에서
하지만 오류
Message: Object of class CI_DB_postgre_result could not be converted to int
내가 여기까지 원하는 것은 $ 쿼리의 값이 0 인 경우, 내가 나눌 수 있습니다를 얻을.
$ 질의 -> NUM_ROWS을 당신은 너무 같은 쿼리에 의해 반환되는 행의 수를 확인할 수 있습니다
: – fxfilmxf
@fxfilmxf와 같이,'if ($ query-> num_rows()> 0)' – ranisalt
@fxfilmxf를 사용하십시오. 나는 그것을 확인할 수 있었다. 그러나 어쨌든 txx는 작동합니다. – Kino