php - How to know if any row of a table satisfies a condition -


i executing codeigniter statement select row table following query:

$result = $this->db->query('select * table_name cond1 , cond2); 

but how know row selected or not. have used count($result) determine number of rows selected. returning 1 in both cases i.e. when row satisfies conditions , when no row not satisfy condition. asking whether there way check that. thank you.

here assume there can 1 row present satisfying cond1 , cond2.

if($result->num_rows()>0){     //one or more rows satisfies condition }else {     //zero rows satisfies condition } 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -