$query = DB::query(Database::SELECT, "select * from users where username like :username") ;
$query->param(':username', $username) ;
$query->parameters(array(
':username' => '%'. $username. '%'
)) ;
$result = $query->execute()->as_array() ;
if ($result->count() > 0)
{
return $result ;
}
else
{
return null ;
}
ErrorException [致命錯誤]:調用一個成員函數COUNT()一個非對象
如何得到的結果查詢?有人幫助..thx ..
你嘗試'如果(計數($結果)> 0)'? – stealthyninja