pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <tfoot id='zuSEi'></tfoot>

      <legend id='zuSEi'><style id='zuSEi'><dir id='zuSEi'><q id='zuSEi'></q></dir></style></legend>
          <bdo id='zuSEi'></bdo><ul id='zuSEi'></ul>

        <small id='zuSEi'></small><noframes id='zuSEi'>

        <i id='zuSEi'><tr id='zuSEi'><dt id='zuSEi'><q id='zuSEi'><span id='zuSEi'><b id='zuSEi'><form id='zuSEi'><ins id='zuSEi'></ins><ul id='zuSEi'></ul><sub id='zuSEi'></sub></form><legend id='zuSEi'></legend><bdo id='zuSEi'><pre id='zuSEi'><center id='zuSEi'></center></pre></bdo></b><th id='zuSEi'></th></span></q></dt></tr></i><div class="q4so4s4" id='zuSEi'><tfoot id='zuSEi'></tfoot><dl id='zuSEi'><fieldset id='zuSEi'></fieldset></dl></div>

        mysqli_query(): 無法獲取 mysqli 錯誤

        mysqli_query(): Couldn#39;t fetch mysqli error(mysqli_query(): 無法獲取 mysqli 錯誤)
        <tfoot id='IPKYK'></tfoot>
          <tbody id='IPKYK'></tbody>

        • <bdo id='IPKYK'></bdo><ul id='IPKYK'></ul>

                <small id='IPKYK'></small><noframes id='IPKYK'>

                <i id='IPKYK'><tr id='IPKYK'><dt id='IPKYK'><q id='IPKYK'><span id='IPKYK'><b id='IPKYK'><form id='IPKYK'><ins id='IPKYK'></ins><ul id='IPKYK'></ul><sub id='IPKYK'></sub></form><legend id='IPKYK'></legend><bdo id='IPKYK'><pre id='IPKYK'><center id='IPKYK'></center></pre></bdo></b><th id='IPKYK'></th></span></q></dt></tr></i><div class="s4q4yu4" id='IPKYK'><tfoot id='IPKYK'></tfoot><dl id='IPKYK'><fieldset id='IPKYK'></fieldset></dl></div>

                  <legend id='IPKYK'><style id='IPKYK'><dir id='IPKYK'><q id='IPKYK'></q></dir></style></legend>
                • 本文介紹了mysqli_query(): 無法獲取 mysqli 錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  當我嘗試從文本文件導入數據時,我在以下函數中收到無法獲取 mysqli"錯誤.然而,插入功能在其他地方工作得很好.文件中的數據被正確解析,當我將其復制并粘貼到 PHPMyAdmin 時,查詢工作正常.

                  I am receiving a "Couldn't fetch mysqli" error on the following function when trying to import data from a text file. However the insert function is working just fine in other places. The data from the file is being parsed correctly, and the query works fine when I copy and past it into PHPMyAdmin.

                  功能

                  1. $conn = mysqli_connect("localhost","xxxxx","xxxxx","xxxx") OR die("Error!!");
                  2. function insert ($query){
                  3.  global $conn;
                  4.  if (!$conn) {
                  5.          die("Connection failed: " . mysqli_connect_error());
                  6.  }
                  7.  if (mysqli_query($conn, $query)){
                  8.      $result = "<b>Inserted $query</b>
                  <br />";
                  9.      return $result;
                  10. } else {
                  11.     echo "Error: ". $query . "<br />" . mysqli_error($conn);
                  12. }
                  13. 
                  14. mysqli_close($conn);
                  15. }
                  

                  我要插入的查詢是:

                  INSERT INTO movies VALUES( '2603', 'Miracle Season, The', 'The Miracle Season', '2019-04-01',
                  '2D', '9', '101', '10', 'PG', 'for some thematic elements.', '', 'Scope', '01:30:55' )
                  

                  我通過 $result = insert($query); 調用函數;

                  I am calling the function by $result = insert($query);

                  無法獲取 mysqli"錯誤在第 7 行.我也在第 11 行和第 14 行收到錯誤.

                  The "couldn't fetch mysqli" error is on line 7. I'm also getting the error on line 11 and line 14.

                  正如我上面所說,該函數與其他腳本一起運行良好,當我嘗試手動運行時,查詢運行良好.

                  As I said above, the function is working fine with other scripts and the query works fine when I try to run it manually.

                  另外一個注意事項是插入的項目不包含自動遞增 id,因為查詢的第一個值已經是來自另一個數據庫的唯一 id.我的導入函數檢查 id 以查看它是否已經存在,并根據行是否存在運行更新或插入查詢.

                  One additional note is the inserted items do not contain an auto increment id because the first value of the query is already a unique id from another database. My import function checks the id to see if it already exists and runs an update or insert query depending on whether the row exists.

                  推薦答案

                  我懷疑您多次調用該函數.但是它在最后調用了mysqli_close($conn),所以當你下次嘗試使用它時出現錯誤,因為$conn不能使用任何更多.

                  I suspect you're calling the function multiple times. But it calls mysqli_close($conn) at the end, so when you try to use it the next time you get an error, because $conn can't be used any more.

                  去掉那一行,用 MySQL 腳本全部完成后關閉連接(或者不用管,腳本結束時它會自動關閉).

                  Get rid of that line, and close the connection when the script is all done using MySQL (or don't bother, it will be closed automatically when the script ends).

                  這篇關于mysqli_query(): 無法獲取 mysqli 錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                  Call to undefined function mysqli_result::num_rows()(調用未定義的函數 mysqli_result::num_rows())
                  PHP Prepared Statement Problems(PHP 準備好的語句問題)
                  mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個結果)
                  PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
                  How do I make sure that values from MySQL keep their type in PHP?(如何確保 MySQL 中的值在 PHP 中保持其類型?)
                    <bdo id='tBMcw'></bdo><ul id='tBMcw'></ul>
                    <i id='tBMcw'><tr id='tBMcw'><dt id='tBMcw'><q id='tBMcw'><span id='tBMcw'><b id='tBMcw'><form id='tBMcw'><ins id='tBMcw'></ins><ul id='tBMcw'></ul><sub id='tBMcw'></sub></form><legend id='tBMcw'></legend><bdo id='tBMcw'><pre id='tBMcw'><center id='tBMcw'></center></pre></bdo></b><th id='tBMcw'></th></span></q></dt></tr></i><div class="iaskccc" id='tBMcw'><tfoot id='tBMcw'></tfoot><dl id='tBMcw'><fieldset id='tBMcw'></fieldset></dl></div>

                        • <tfoot id='tBMcw'></tfoot>
                          <legend id='tBMcw'><style id='tBMcw'><dir id='tBMcw'><q id='tBMcw'></q></dir></style></legend>

                            <tbody id='tBMcw'></tbody>

                          1. <small id='tBMcw'></small><noframes id='tBMcw'>

                            主站蜘蛛池模板: 渗透仪-直剪仪-三轴仪|苏州昱创百科 | 企业微信scrm管理系统_客户关系管理平台_私域流量运营工具_CRM、ERP、OA软件-腾辉网络 | 隐形纱窗|防护纱窗|金刚网防盗纱窗|韦柏纱窗|上海青木装潢制品有限公司|纱窗国标起草单位 | 汽车水泵_汽车水泵厂家-瑞安市骏迪汽车配件有限公司 | 鑫铭东办公家具一站式定制采购-深圳办公家具厂家直销 | 电动葫芦-河北悍象起重机械有限公司 | 档案密集架_电动密集架_移动密集架_辽宁档案密集架-盛隆柜业厂家现货批发销售价格公道 | 深圳快餐店设计-餐饮设计公司-餐饮空间品牌全案设计-深圳市勤蜂装饰工程 | 苏州同创电子有限公司 - 四探针测试仪源头厂家 | 气动机械手-搬运机械手-气动助力机械手-山东精瑞自动化设备有限公司 | 上海办公室装修,办公楼装修设计,办公空间设计,企业展厅设计_写艺装饰公司 | 无尘烘箱_洁净烤箱_真空无氧烤箱_半导体烤箱_电子防潮柜-深圳市怡和兴机电 | IIS7站长之家-站长工具-爱网站请使用IIS7站长综合查询工具,中国站长【WWW.IIS7.COM】 | 山楂片_雪花_迷你山楂片_山楂条饼厂家-青州市丰源食品厂 | 震动筛选机|震动分筛机|筛粉机|振筛机|振荡筛-振动筛分设备专业生产厂家高服机械 | 低浓度恒温恒湿称量系统,强光光照培养箱-上海三腾仪器有限公司 | 橡胶接头|可曲挠橡胶接头|橡胶软接头安装使用教程-上海松夏官方网站 | 广州企亚 - 数码直喷、白墨印花、源头厂家、透气无手感方案服务商! | 定制液氮罐_小型气相液氮罐_自增压液氮罐_班德液氮罐厂家 | 宝元数控系统|对刀仪厂家|东莞机器人控制系统|东莞安川伺服-【鑫天驰智能科技】 | vr安全体验馆|交通安全|工地安全|禁毒|消防|安全教育体验馆|安全体验教室-贝森德(深圳)科技 | 原子吸收设备-国产分光光度计-光谱分光光度计-上海光谱仪器有限公司 | 代理记账_免费注册公司_营业执照代办_资质代办-【乐财汇】 | 西点培训学校_法式西点培训班_西点师培训_西点蛋糕培训-广州烘趣西点烘焙培训学院 | 北京模型公司-工业模型-地产模型-施工模型-北京渝峰时代沙盘模型制作公司 | 喷码机,激光喷码打码机,鸡蛋打码机,手持打码机,自动喷码机,一物一码防伪溯源-恒欣瑞达有限公司 | 管家婆-管家婆软件-管家婆辉煌-管家婆进销存-管家婆工贸ERP | 三价铬_环保铬_环保电镀_东莞共盈新材料贸易有限公司 | 特种电缆厂家-硅橡胶耐高温电缆-耐低温补偿导线-安徽万邦特种电缆有限公司 | 粉碎机_塑料粉碎机_塑料破碎机厂家-星标机械 | bkzzy在职研究生网 - 在职研究生招生信息咨询平台 | 专注提供国外机电设备及配件-工业控制领域一站式服务商-深圳市华联欧国际贸易有限公司 | 周口市风机厂,周鼓风机,河南省周口市风机厂 | 丹佛斯压力传感器,WISE温度传感器,WISE压力开关,丹佛斯温度开关-上海力笙工业设备有限公司 | 基本型顶空进样器-全自动热脱附解吸仪价格-AutoHS全模式-成都科林分析技术有限公司 | 爱佩恒温恒湿测试箱|高低温实验箱|高低温冲击试验箱|冷热冲击试验箱-您身边的模拟环境试验设备技术专家-合作热线:400-6727-800-广东爱佩试验设备有限公司 | 山东活动策划|济南活动公司|济南公关活动策划-济南锐嘉广告有限公司 | 一体化净水器_一体化净水设备_一体化水处理设备-江苏旭浩鑫环保科技有限公司 | 罗氏牛血清白蛋白,罗氏己糖激酶-上海嵘崴达实业有限公司 | 创客匠人-让IP变现不走弯路 | 深圳善跑体育产业集团有限公司_塑胶跑道_人造草坪_运动木地板 |