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如果只有你把你的评论置于回答中。我可以检查它。但tnx无论如何它的工作 – Kino