if($this->cuvant_cautat)
{
$this->cuvant_cautat = $this->bd->query("SELECT cuvant_raspuns FROM dc_asociatii WHERE cuvant_stimul='".$this->cuvant_cautat."' ORDER BY id DESC LIMIT 0, 5");
//echo $this->cuvant_cautat[0];
while($this->cuvant_cautat = $this->cuvant_cautat->fetch_array(MYSQLI_NUM))
{
echo $this->cuvant_cautat[0];
}
}
致命错误:在数组中调用成员函数fetch_array() 第89行的C:\ xampp \ htdocs \ motor \ classes \ user.Class.php
第89行如下:
while($this->cuvant_cautat = $this->cuvant_cautat->fetch_array(MYSQLI_NUM))
答案 0 :(得分:2)
您每次都会覆盖$this->cuvant_cautat
。在迭代中使用不同的变量。
while ($something_else = $this->cuvant_cautat->fetch_array(MYSQLI_NUM))) {
echo $something_else[0];
}