PHP Error: Call to a member function fetch_assoc() on a non-object in PHP ข้อผิดพลาด: การเรียกร้องให้สมาชิกทำงาน fetch_assoc () ที่ไม่ใช่วัตถุใน
Posted on 23. โพสต์ใน 23. Jun, 2009 by Dragos in Coding , PHP มิ.ย., 2,009 โดย Dragos ใน การเข้ารหัส, PHP
If you get this error: Call to a member function fetch_assoc() on a non-object in … , it means that you have an error in your mysql syntax. หากท่านพบข้อผิดพลาดนี้เรียกร้องให้สมาชิกทำงาน fetch_assoc () ที่ไม่ใช่วัตถุใน ... ก็หมายความว่าคุณมีข้อผิดพลาดในรูปแบบของ MySQL. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. หากว่า $ mysqli เป็นวัตถุการเชื่อมต่อฐานข้อมูลทำให้สะท้อน mysqli-$ ข้อผิดพลาด>; เพียงก่อนบรรทัดที่คุณได้รับข้อผิดพลาดใน.
$mysqli=new mysqli(HOST,USER,PASS,DB); mysqli $ = mysqli ใหม่ (HOST ผู้ใช้, โลโก้, DB); $mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ mQuery = $ mysqli-ค้นหา> ข้อมูล `( 'เลือก` จาก `this_table` ที่ `id` = 1'); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` สะท้อน-mysqli $ ข้อผิดพลาด>; / echoes / ว่าข้อมูล `คอลัมน์` ไม่มีในตาราง `this_table` $row=$mQuery->fetch_assoc(); //gives error as the column `data` is in table `that_table`, not in table `this_table` แถว $ = $ mQuery-> fetch_assoc () / / ให้ผิดพลาดเป็นคอลัมน์ `เป็น` ข้อมูลในตาราง `that_table` ไม่ในตาราง `this_table` $mysqli->close(); $ mysqli-ปิด> ();
Related posts: บทความที่เกี่ยวข้อง:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: สะดวกรีเซ็ตรหัสผ่านบัญชีของคุณโดยใช้ MySQL และ PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database รหัส: วิธีการเรียกข้อมูลโปรไฟล์ผู้ใช้กับ SSI.php จากฐานข้อมูลเวที SMF
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: วิธีการรับดัชนี (ตำแหน่งภายในกลุ่ม) ของวัตถุด้วย jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: ส่งหน้าที่เป็นพารามิเตอร์ทำงาน (callbacks อื่น)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time เทอร์มิอูบุนตู: ประเภทโฮสต์ไม่ถูกต้องและและกำหนดค่า: ข้อผิดพลาด: สามารถกำหนดค่าเฉพาะสำหรับโฮสต์และหนึ่งเป้าหมายในเวลา
- Jenny สัตว์ตัวเมีย












































