why does mysqli fetch create an infinite loop when in function?
问题 Why does this function return an infinite loop? I am trying to create a function where you just have to give it the query and the while loop takes care of the rest. but for some reason ONLY when i have the function return $q->fetch_assoc() it goes into an infinite loop. if I return just $q, then call $q->fetch_assoc() in the while loop then it doesn't cause the infinite loop. public function fetch($query){ $con = $this->con; $q = $con->query($query); return $q->fetch_assoc(); } while($r =