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 ();
Related posts: Related posts:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Mudah Reset Password Account Anda Menggunakan MySQL dan PHP
- 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
- 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?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Kirim fungsi sebagai parameter ke fungsi lain (callback)
- 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












































