PHP MySQL Warning : mysqli_fetch_array() expects parameter 1 to be mysqli_result -


इस सवाल का पहले से ही एक उत्तर है: < / p>

  • 33 उत्तर

    यह मेरा PHP कोड है: <पूर्व> & lt; html & gt; & Lt; शीर्ष & gt; & Lt; title & gt; एसक्यूएल डीबी प्रबंधन & lt; / title & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; h1 & gt; mysqladmin & lt; / h1 & gt; & LT; तालिका & gt; & LT; टीआर & gt; & Lt; th & gt; & lt;! - शीर्षक 1 - & gt; & lt; / th & gt; & Lt; th & gt; & lt;! - हेडिंग 2 - & gt; & lt; / th & gt; & Lt; th & gt; & lt;! - इसे खाली छोड़ें - & gt; & lt; / th & gt; & Lt; / टीआर & gt; & Lt;? Php $ db_host = "mysql.freehostingnoads.net"; $ Db_username = ""; $ Db_password = ""; $ db_name = ""; $ db_table = ""; $ db = mysqli_connect ($ db_host, $ db_username, $ db_password, $ db_name); अगर (mysqli_connect_errno ()) (मर ("MySQL से जुड़ने में असफल:"। Mysql_connect_error ());} $ content = mysqli_query ($ db, "SELECT * FROM"। $ Db_table); जबकि ($ line = mysqli_fetch_array ($ सामग्री)) {गूंज ("& lt; tr & gt;"); गूंज ("& lt; td & gt;"। $ पंक्ति ['सी 1']। "& lt; / td & gt;"); गूंज ("& lt; td & gt;"। $ पंक्ति ['सी 2']। "& lt; / td & gt;"); #delete बटन गूंज ("& lt; td & gt; & lt; form action = 'del.php' method = 'GET' & gt; & lt; इनपुट प्रकार = 'टेक्स्ट' नाम = 'c1' मान = '"। $ Line [' c1 ']। "' / & Gt; & lt; input type = 'text' name = 'c2' मान = ''। $ Line ['c2']। '' / & Gt; & lt; इनपुट प्रकार = 'बटन' मान = ' DEL '/ & gt; & lt; / form & gt; & lt; / td & gt; "); गूंज ( "& lt; / टीआर & gt;"); }? & Gt; & Lt; / body & gt; & Lt; / html & gt;

    और बस & lt; head & gt; को पढ़ना छोड़ दें, यह मुझे मिली चेतावनी है:

    चेतावनी: mysqli_fetch_array ()

    मैं खोज की है लेकिन जवाब नहीं मिल सकता पैरामीटर 1 mysqli_result होने की उम्मीद है, बूलीयन /home/u273577101/public_html/index.php में लाइन 23 पर दिया

    यहां समस्या क्या है?
    कोई कनेक्शन त्रुटि नहीं है, मुझे लगता है। यह मुझे कनेक्ट करने के बारे में कोई त्रुटि संदेश देने में प्रतीत नहीं होता।

    mysqli_query बूलीयन FALSE लौट रहा है क्योंकि आपका $ db_table वेरिएबल एक रिक्त स्ट्रिंग पर सेट है और इसलिए परिणामस्वरूप आप जो क्वेरी दे रहे हैं वह अमान्य है।

    आप बस एक वैध तालिका नाम के लिए $ db_table चर सेट करना होगा।

Comments

Popular posts from this blog

c# - Roxy file manager in MVC doesn't accept session path -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

java - Ajax call to jsp and jsp redirecting to further jsp -