gpt4 book ai didi

php - 调用数组的成员函数 fetch_array()

转载 作者:行者123 更新时间:2023-11-29 06:28:03 26 4
gpt4 key购买 nike

    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];
}
}

Fatal error: Call to a member function fetch_array() on array in C:\xampp\htdocs\motor\classes\user.Class.php on line 89

第89行如下:

while($this->cuvant_cautat = $this->cuvant_cautat->fetch_array(MYSQLI_NUM))

最佳答案

你每次都在覆盖 $this->cuvant_cautat。在迭代中使用不同的变量。

while ($something_else = $this->cuvant_cautat->fetch_array(MYSQLI_NUM))) {
echo $something_else[0];
}

关于php - 调用数组的成员函数 fetch_array(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29720870/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com