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

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Call to locekļa funkciju fetch_assoc () par bez objekts

Posted on 23. Posted on 23. Jun, 2009 by Dragos in Coding , PHP Jun, 2009 by Dragos in kodēšanas, 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. Ja jums tas error: Call to locekļa funkciju fetch_assoc () par bez objektu ... tas nozīmē, ka jums ir kļūda jūsu mysql sintaksi. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Pieņemot, ka $ mysqli ir jūsu datu bāzes savienojuma objektu nodot echo $ mysqli-> error, vienkārši pirms līniju saņemat kļūdu.

$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 ( "izvēlieties" datu `no` this_table `ja` id `= 1 ');
echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / atbalsis, ka kolonna "dati" neeksistē tabulā `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 (); / / dod kļūdu kolonna "dati" ir tabula `that_table", nevis tabulā `this_table`
$mysqli->close(); $ mysqli-> Close ();
Translate this post Tulkot šo ziņu


Related posts: Related posts:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Viegli Reset Your account password Ar MySQL un PHP
  2. PHP: How to download a webpage (aka web scrapping) with PHP PHP: Kā lejupielādēt tīmekļa vietnē (pazīstams arī kā web metāllūžņos) ar PHP
  3. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Kā ielādēt lietotāja profila datus ar SSI.php no SMF foruma datubāze
  4. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Kā nokļūt indekss (amatu grupā) un objekts ar jQuery?
  5. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Sūtīt funkcija kā parametru citai funkcijai (callbacks)

  • Jenny Jenny
    Pretty nice post. Pretty nice post. I just found your site and wanted to say Es tikko atrast savu vietu un gribēju pateikt
    that I've really enjoyed reading your blog posts. ka es esmu patiešām patika lasīt jūsu blog posts. Anyway Katrā ziņā
    I'll be subscribing to your blog and I hope you write again soon! Es būšu, parakstoties uz jūsu emuāru, un es ceru, ka jūs rakstīt drīz atkal!
blog comments powered by Disqus blog komentāriem powered by Disqus