您正在尝试获取非对象

时间:2015-07-01 15:46:59

标签: php mysqli

控制页面上的

function tinyf_users_get($extra ='')
{
    global $tf_handle;
    $query = sprintf("SELECT * FROM `users` %s",$extra );
    $qresult = mysqli_query($tf_handle, $query);

    if (!$qresult)
        return NULL;
    $recount = mysqli_num_rows($qresult);
    if ($recount == 0)
        return NULL ;
    $users = array();
    for($i = 0 ; $i < $recount ; $i++)
        $users[count($users)] = mysqli_fetch_object($qresult);
    //mysql_free_result($qresult);

    echo $users -> name  . "<br/>" ;
    return $users;

}

我试图运行====&gt;

<?php
include ('db.php') ;
$result = tinyf_users_get('WHERE id ='. 36);
if($result){
    echo "yup";
}
else{
    echo "no";
}
error_reporting(E_ALL);
ini_set('display_errors', 1);

?>
  

注意:尝试在第19行的/var/www/html/tinyforum/usersAPI.php中获取非对象的属性

0 个答案:

没有答案