PHP Error: Call to a member function fetch_assoc() on a non-object in PHP שגיאה: הסב חבר פונקציה fetch_assoc () on a non-האובייקט
Posted on 23. פורסם ב 23. Jun, 2009 by Dragos in Coding , PHP יוני, 2009 על ידי Dragos ב וקידוד, 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. אם אתה מקבל שגיאה זו: הסב חבר פונקציה fetch_assoc () on a non-object in ..., זה אומר שיש לך שגיאה בתחביר MySQL שלך. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. בהנחה $ MySQLi הוא אובייקט חיבור למסד הנתונים שלך, לשים echo $ MySQLi-> שגיאה; ממש לפני הקו אתה מקבל את השגיאה ב.
$mysqli=new mysqli(HOST,USER,PASS,DB); MySQLi $ = MySQLi חדש (HOST, USER, PASS, DB); $mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ $ = mQuery MySQLi-> query ( 'בחר `נתונים` מ `this_table` שם `id` = 1'); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` הד $ MySQLi-> השגיאה: / / הדים כי הנתונים טור `` אינו קיים בטבלה 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 (); / / נותן שגיאה כמו העמודה `נתונים` היא בטבלה that_table ``, `לא בטבלה this_table` $mysqli->close(); $ MySQLi-> קרוב ();
Related posts: הודעות קשורות:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP וורדפרס: בקלות איפוס סיסמת חשבון שלך באמצעות MySQL ו-PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database קידוד: כיצד להביא את נתוני פרופיל המשתמש עם SSI.php ממסד נתונים SMF בפורום
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: כיצד לקבל את האינדקס (עמדת בתוך קבוצה) של אובייקט עם jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: שלח פונקציה כפרמטר לפונקציה אחרת (callbacks)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time מסוף אובונטו: סוג מארח לנכים & להגדיר: שגיאה: ניתן להגדיר רק בשביל לארח אחד ואחד היעד במועד












































