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 Opdateringer via RSS | E-mail Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Hjem / Kodning / PHP / PHP Error: Ring til et medlem ...

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Ring til et medlem funktion fetch_assoc () på et ikke-objekt i

Posted on 23. Sendt den 23. Jun, 2009 by Dragos in Coding , PHP Juni, 2009 af Dragos i Kodning, 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. Hvis du får denne fejl: Ring til et medlem funktion fetch_assoc () på en ikke-objekt i ..., betyder det, at du har en fejl i din MySQL syntaks. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Antages, at $ mysql er din database forbindelse objekt, sætte echo $ mysql-> error, lige før den linje, du får fejlen på.

$mysqli=new mysqli(HOST,USER,PASS,DB); $ mysql = new mysql (HOST, BRUGER, PASS, DB);
$mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ mQuery = $ mysql-> query ( "SELECT` data `fra` this_table `, hvor` id `= 1 ');
echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysql-> error; / / ekko, at kolonnen »data« ikke findes i tabellen `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 () / / giver fejl kolonnen »data« er i tabellen `that_table«, ikke i tabellen `this_table`
$mysqli->close(); $ mysql-> close ();
Translate this post Oversæt dette indlæg


Related posts: Relaterede stillinger:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: nemt nulstille din adgangskode Brug af MySQL og PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Hvordan at hente brugerens profil data med SSI.php fra en SMF forum database
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Sådan får du indekset (position inden for en gruppe) af et objekt med jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Send fungere som en parameter til en anden funktion (tilbagekald)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminal: ugyldig vært type & & configure: error: kan kun indstille til en vært og et mål på et tidspunkt

  • Jenny Jenny
    Pretty nice post. Pretty nice post. I just found your site and wanted to say Jeg har lige fundet dit websted og ønskede at sige
    that I've really enjoyed reading your blog posts. at jeg virkelig har nydt at læse dine blog-indlæg. Anyway På en hvilken som helst måde
    I'll be subscribing to your blog and I hope you write again soon! Jeg vil være at abonnere på din blog, og jeg håber du skriver snart igen!
blog comments powered by Disqus blog comments powered by Disqus