Fatal error: Cannot use object of type mysqli_result as array in /home/william/public_html/forums/index.php on line 228

前端 未结 2 904
礼貌的吻别
礼貌的吻别 2021-01-23 16:54

Why won\'t this work? I keep getting that error. // Setup forum topics, post count and last post xxxxx

        $query = array(
            \'SELECT\'    =>         


        
相关标签:
2条回答
  • 2021-01-23 17:45

    You're trying to use a mysqli result ($result) as an array without calling fetch_array on it.

    Whatever framework you're using will probably provide a wrapper for this.

    0 讨论(0)
  • 2021-01-23 17:48

    Well, you seem to have "something" (maybe $result ?) as an object ; and you are using everything as arrays.

    Maybe you have a way to fetch data as arrays, and not objects ? (Might be a way with the class you are using ? )

    Or, you need to access data as objects, and not arrays ; maybe $result->subject, and not $result['subject'] would do ?

    0 讨论(0)
提交回复
热议问题