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 UPDATES VIA RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Home / Coding / PHP / PHP Error: Call to a member ...

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Call to a member function fetch_assoc () pada non-objek

Posted on 23. Dikirim di 23. Jun, 2009 by Dragos in Coding , PHP Jun, 2009 oleh Dragos di Coding, 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. Jika Anda mendapatkan error ini: Panggil ke fungsi anggota fetch_assoc () di non-objek di ..., itu berarti bahwa Anda memiliki kesalahan dalam sintaks mysql Anda. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Misalkan bahwa $ MySQLi adalah objek koneksi database anda, memasukkan echo $ MySQLi-> error; tepat sebelum baris Anda mendapatkan kesalahan pada.

$mysqli=new mysqli(HOST,USER,PASS,DB); $ MySQLi = new MySQLi (HOST, USER, PASS, DB);
$mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ mQuery = $ MySQLi-> query ( 'select `Data` dari `this_table` mana `id` = 1');
echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ MySQLi-> error; / / gema yang kolom `data` tidak ada dalam tabel `this_table`
$row=$mQuery->fetch_assoc(); //gives error as the column `data` is in table `that_table`, not in table `this_table` $ row = $ mQuery-> fetch_assoc (); / / memberikan kesalahan sebagai kolom `data` adalah dalam tabel `that_table`, bukan dalam tabel `this_table`
$mysqli->close(); $ MySQLi-> close ();
Translate this post Terjemahkan posting ini


Related posts: Related posts:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Mudah Reset Password Account Anda Menggunakan MySQL dan PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Bagaimana untuk mengambil data dengan profil pengguna SSI.php dari database forum SMF
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Cara mendapatkan indeks (posisi dalam grup) dari sebuah objek dengan jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Kirim fungsi sebagai parameter ke fungsi lain (callback)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminal: invalid host jenis & & configure: error: hanya bisa mengkonfigurasi untuk satu host dan satu sasaran pada satu waktu

  • Jenny Jenny
    Pretty nice post. Pretty nice posting. I just found your site and wanted to say Aku baru saja menemukan situs Anda dan ingin berkata
    that I've really enjoyed reading your blog posts. bahwa aku telah benar-benar menikmati membaca posting blog Anda. Anyway Bagaimanapun
    I'll be subscribing to your blog and I hope you write again soon! Aku akan berlangganan ke blog Anda dan saya harap Anda menulis lagi segera!
blog comments powered by Disqus blog comments powered by DISQUS