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

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -