我后台使用了sqlite,通过pdo连接。查询代码wz$result = $dbh->query($str_select)->fetch();如何判断$result是否为空?

解决方案 »

  1.   

    不知LZ判断为空是不是要判断是否错误
    不过
    手册里面有关判断是否错误的介绍
    mixed fetch ([ int $fetch_style [, int $cursor_orientation [, int $cursor_offset ]]] )返回值
    The return value of this function on success depends on the fetch type. In all cases, FALSE is returned on failure.