This is a translated page. The original can be found here: http://iwebdevel.com/2009/06/23/php-error-call-to-a-member-function-fetch_assoc-on-a-non-object-in/
UPDATES VIA RSS | Email การปรับปรุงผ่านทาง RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … บ้าน / รหัส / PHP / PHP Error: Call ให้สมาชิก ...

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-ปิด> (); 
Translate this post แปลบทความนี้


Related posts: บทความที่เกี่ยวข้อง:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: สะดวกรีเซ็ตรหัสผ่านบัญชีของคุณโดยใช้ MySQL และ PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database รหัส: วิธีการเรียกข้อมูลโปรไฟล์ผู้ใช้กับ SSI.php จากฐานข้อมูลเวที SMF
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: วิธีการรับดัชนี (ตำแหน่งภายในกลุ่ม) ของวัตถุด้วย jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: ส่งหน้าที่เป็นพารามิเตอร์ทำงาน (callbacks อื่น)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time เทอร์มิอูบุนตู: ประเภทโฮสต์ไม่ถูกต้องและและกำหนดค่า: ข้อผิดพลาด: สามารถกำหนดค่าเฉพาะสำหรับโฮสต์และหนึ่งเป้าหมายในเวลา

  • Jenny สัตว์ตัวเมีย
    Pretty nice post. สวยโพสต์ดี. I just found your site and wanted to say ฉันพบเว็บไซต์ของคุณและต้องการกล่าว
    that I've really enjoyed reading your blog posts. ที่ฉันมีความสุขจริงๆอ่านบทความบล็อกของคุณ. Anyway ถึงอย่างไร
    I'll be subscribing to your blog and I hope you write again soon! ฉันจะสมัครไปยังบล็อกของคุณและฉันหวังว่าคุณเขียนอีกครั้งเร็วๆนี้!
blog comments powered by Disqus บล็อกความคิดเห็นขับเคลื่อนโดย Disqus