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 Aktualizáciou cez RSS | E-mail Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Home / Kódovanie / PHP / PHP Error: Výzva k členom ...

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Call to členskú funkciu fetch_assoc () na non-objekt

Posted on 23. Publikované dňa 23. Jun, 2009 by Dragos in Coding , PHP Júna 2009 od Dragos v Kódovanie, 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. Ak sa vám táto chyba: Výzva na členskú funkciu fetch_assoc () na non-objekt v ..., to znamená, že máte chybu v mysql syntax. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. $ Mysqli za predpokladu, že je vaše pripojenie k databáze objektu, dal echo $ mysqli-> error; tesne pred riadok dostaneš chybe.

 $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` z `this_table` kde `id` = 1'); 
 echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / echoes, že stĺpec "dáta" neexistuje v tabuľke `` 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 (); / / obsahuje chyby stĺpec "dáta" je v tabuľke `that_table", nie je v tabuľke `` this_table 
 $mysqli->close(); $ Mysqli-> close (); 
Translate this post Translate this post


Related posts: Súvisiace príspevky:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Ľahko Obnoviť heslo k vášmu účtu pomocou PHP a MySQL
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Kódovanie: Ako načítať údaje profil užívateľa SSI.php z databázy fórum SMF
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Ako sa dostať na indexe (pozíciu v rámci skupiny) z objektu s jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Poslať funkcii ako parameter inej funkcie (volanie)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminálu: neplatný typ hosť & & configure: error: možno nakonfigurovať iba jeden hostiteľ a jeden cieľ v čase

  • Jenny Jenny
    Pretty nice post. Docela pekné miesto. I just found your site and wanted to say Len som našiel Vašu stránku a chcela som povedať
    that I've really enjoyed reading your blog posts. že som sa naozaj tešil čítanie vášho blogu. Anyway Napriek tomu
    I'll be subscribing to your blog and I hope you write again soon! Budem prihlásení do svojho blogu, a dúfam, že napíšete zase čoskoro!
blog comments powered by Disqus blog pripomienky powered by Disqus