不是。E文原文:
You also have to fetch all result rows from an unbuffered SQL query, before you can send a new SQL query to MySQL这里的提取是指把数据取出来。

解决方案 »

  1.   

    问题接着来:怎么样才能算"提取掉所有未缓存的结果行"?我用while($array=mysql_fetch_array($result)) {
    ...
    }
    mysql_free_result($result);这样算不算?
      

  2.   

    具体情况如下:程序A中用mysql_unbuffered_query返回了$result,mysql_fetch_array($result)很正常,但在程序中继续使用mysql_unbuffered_query却出现错误,返回的$result不能被mysql_fetch_array了,错误提示是 [Number] is not a valid MySQL result resource in ****其中[Number]是$result的资源标识符
      

  3.   

    源代码是对象封装的,为了简化说明我去掉了对象,把方法和实际调用写在一起:function __getlist($parameters[,...]) {
    $query = "......";if($result = @mysql_unbuffered_query($query, $conn){
        return $result;
    }
    else {
        return NULL;
    }
    }$result = __getlist($parameter);while($array = mysql_fetch_array($result)){ // breakpoint1......}
    mysql_free_result($result); // breakpoint#2
    unset($array);breakpoint#1和#2出错是不是在请求这个query之前有某个$result没有被fetch完?另外,交替使用mysql_query和mysql_unbuffered_query会不会出错?(这是另一个问题了,呵呵)
      

  4.   

    if($result = @mysql_unbuffered_query($query, $conn){
    在这里已经出错了!!!
      

  5.   

    感谢楼上的细心,这是我在为了贴代码上来,再改动的时候出的差错,呵呵。另:问题根源已经找到了,是我在循环读mysql_unbuffered_query出来的$result时,调用了其他对象中的mysql_query,所以出错。
    在此谢谢各位