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

    1. <legend id='L7ihZ'><style id='L7ihZ'><dir id='L7ihZ'><q id='L7ihZ'></q></dir></style></legend>

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

      <tfoot id='L7ihZ'></tfoot>
          <bdo id='L7ihZ'></bdo><ul id='L7ihZ'></ul>

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

        未定義索引:___mysqli_ston

        Undefined index: ___mysqli_ston(未定義索引:___mysqli_ston)

          <legend id='46Hfx'><style id='46Hfx'><dir id='46Hfx'><q id='46Hfx'></q></dir></style></legend>
              <bdo id='46Hfx'></bdo><ul id='46Hfx'></ul>
                <tbody id='46Hfx'></tbody>
              • <tfoot id='46Hfx'></tfoot>

                  <small id='46Hfx'></small><noframes id='46Hfx'>

                1. <i id='46Hfx'><tr id='46Hfx'><dt id='46Hfx'><q id='46Hfx'><span id='46Hfx'><b id='46Hfx'><form id='46Hfx'><ins id='46Hfx'></ins><ul id='46Hfx'></ul><sub id='46Hfx'></sub></form><legend id='46Hfx'></legend><bdo id='46Hfx'><pre id='46Hfx'><center id='46Hfx'></center></pre></bdo></b><th id='46Hfx'></th></span></q></dt></tr></i><div class="j7xl7l7" id='46Hfx'><tfoot id='46Hfx'></tfoot><dl id='46Hfx'><fieldset id='46Hfx'></fieldset></dl></div>
                  本文介紹了未定義索引:___mysqli_ston的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在嘗試將一些 json 數(shù)據(jù)從文件解析到 mysql 數(shù)據(jù)庫(kù)中.我的原始代碼如下:

                  I am trying to parse some json data, into a mysql database, from a file. My original code was as follows:

                  <?php
                  $response = array();
                  $res=array();
                  $json = file_get_contents('C:UsersRichardDesktop	est.json');
                  
                  if($json!=null){
                  $decoded=json_decode($json,true);
                  //$decode= var_dump($decoded);
                  //$ss=$decode["array"];
                  //echo $decoded['number'];
                  
                  if(is_array($decoded["configurationItems"]))
                  {
                  foreach($decoded["configurationItems"] as $configurationItems)
                  //for($i=0;$i>sizeof($decoded["configurationItems"]);$i++)
                  
                   {
                  
                  
                  $configurationItemVersion=$configurationItems["configurationItemVersion"];
                  echo "<br />","configurationItemVersion:",$configurationItemVersion,"<br    />";
                  
                  $configurationItemCaptureTime=$configurationItems["configurationItemCaptureTime"];
                  echo "configurationItemCaptureTime:",$configurationItemCaptureTime,"<br />";
                  
                  $configurationStateId=$configurationItems["configurationStateId"];
                  echo "configurationStateId:",$configurationStateId,"<br />";
                  
                  
                   $result = mysql_query("INSERT INTO configuration_item(configurationItemVersion,configurationItemCaptureTime,configurationStateId)
                  
                  
                  VALUES('$configurationItemVersion','$configurationItemCaptureTime','$configurationStateId')")or die("Insert Failed ".mysql_error());;
                  
                  }// check if row inserted or not
                  if ($result) {
                      // successfully inserted into database
                      $response["code"] = 1;
                      $response["message"] = "successfully stored";
                  
                      // echoing JSON response
                      echo json_encode($response);
                  } else {
                      // failed to insert row
                      $response["code"] = 2;
                      $response["message"] = "Oops! An error occurred.";
                  
                      // echoing JSON response
                      echo json_encode($response);
                  }
                  
                  }
                  }
                  

                  ?>

                  由于被貶低而失敗;因此,我沒(méi)有更改錯(cuò)誤處理程序以忽略這一點(diǎn)(非常糟糕的做法),而是選擇使用此處提供的便捷轉(zhuǎn)換工具轉(zhuǎn)換為 mysqli:https://github.com/philip/MySQLConverterTool

                  which failed due to being depricated; so rather than altering the error handler to ignore this (really bad practice), I opted to convert to mysqli using a handy conversion tool sourced here : https://github.com/philip/MySQLConverterTool

                  我在上述代碼上運(yùn)行轉(zhuǎn)換器并生成以下內(nèi)容:

                  I ran the converter on the aforementioned code and it generated the following:

                  <?php 
                  $response = array(); 
                  $res=array(); 
                  $json = file_get_contents('C:UsersRichardDesktop	est.json'); 
                  
                  if($json!=null){ 
                  $decoded=json_decode($json,true); 
                  //$decode= var_dump($decoded); 
                  //$ss=$decode["array"]; 
                  //echo $decoded['number']; 
                  
                  if(is_array($decoded["configurationItems"])) 
                  { 
                  foreach($decoded["configurationItems"] as $configurationItems) 
                  //for($i=0;$i>sizeof($decoded["configurationItems"]);$i++) 
                  
                   { 
                  
                  
                  $configurationItemVersion=$configurationItems["configurationItemVersion"]; 
                  echo "<br />","configurationItemVersion:",$configurationItemVersion,"<br />"; 
                  
                  $configurationItemCaptureTime=$configurationItems["configurationItemCaptureTime"]; 
                  echo "configurationItemCaptureTime:",$configurationItemCaptureTime,"<br />"; 
                  
                  $configurationStateId=$configurationItems["configurationStateId"]; 
                  echo "configurationStateId:",$configurationStateId,"<br />"; 
                  
                  
                  $result = mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO     configuration_item(configurationItemVersion,configurationItemCaptureTime,configurationStateId) 
                  
                  
                  VALUES('$configurationItemVersion','$configurationItemCaptureTime','$configurationStateId')")or die("Insert Failed ".((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error(
                   "]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));; 
                  
                  }// check if row inserted or not 
                  if ($result) { 
                      // successfully inserted into database 
                      $response["code"] = 1; 
                      $response["message"] = "successfully stored"; 
                  
                      // echoing JSON response 
                      echo json_encode($response); 
                  } else { 
                      // failed to insert row 
                      $response["code"] = 2; 
                      $response["message"] = "Oops! An error occurred."; 
                  
                      // echoing JSON response 
                      echo json_encode($response); 
                  } 
                  
                  } 
                  } 
                  
                  
                  
                  ?> 
                  

                  在運(yùn)行此代碼時(shí),我收到標(biāo)題中的錯(cuò)誤消息(未定義索引:___mysqli_ston)并且不知道如何修復(fù)它,任何幫助將不勝感激.

                  upon running this code I get the error message in the title (Undefined index: ___mysqli_ston) and have no idea how to fix it, any help would be much appreciated.

                  ps 我正在使用 laravel 框架,如果這有所作為或開(kāi)辟了其他解決方案.

                  ps I am using the laravel framework if that makes a difference or opens up other solutions.

                  我現(xiàn)在知道錯(cuò)誤與我沒(méi)有數(shù)據(jù)庫(kù)連接字符串有關(guān),即 $GLOBALS["___mysqli_ston 是由生成器生成的.

                  I now know that the error relates to the fact that I have no database connection string ie $GLOBALS["___mysqli_ston is generated by the generator.

                  據(jù)我了解,laravel 負(fù)責(zé)在其 mvc 架構(gòu)中定義數(shù)據(jù)庫(kù)連接,因此不需要重新定義.考慮到這一點(diǎn),我的代碼會(huì)是什么樣子?

                  it was my understanding that laravel took care of defining the database connection in its mvc architecture and therefore this does not need to be redefined. with that in mind what would my code look like ?

                  推薦答案

                  你一定已經(jīng)用這樣的東西連接到 mysql

                  you must have connected to mysql using something like this

                  $con=mysqli_connect("localhost","my_user","my_password","my_db");
                  

                  替換你的這一行

                  $result = mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO     configuration_item(configurationItemVersion,configurationItemCaptureTime,configurationStateId) 
                  

                  有了這個(gè)

                  $result = mysqli_query($con, "INSERT INTO     configuration_item(configurationItemVersion,configurationItemCaptureTime,configurationStateId) 
                  

                  這篇關(guān)于未定義索引:___mysqli_ston的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                  <i id='3jK1t'><tr id='3jK1t'><dt id='3jK1t'><q id='3jK1t'><span id='3jK1t'><b id='3jK1t'><form id='3jK1t'><ins id='3jK1t'></ins><ul id='3jK1t'></ul><sub id='3jK1t'></sub></form><legend id='3jK1t'></legend><bdo id='3jK1t'><pre id='3jK1t'><center id='3jK1t'></center></pre></bdo></b><th id='3jK1t'></th></span></q></dt></tr></i><div class="zvxtzlj" id='3jK1t'><tfoot id='3jK1t'></tfoot><dl id='3jK1t'><fieldset id='3jK1t'></fieldset></dl></div>

                      <tbody id='3jK1t'></tbody>

                        <bdo id='3jK1t'></bdo><ul id='3jK1t'></ul>

                        1. <legend id='3jK1t'><style id='3jK1t'><dir id='3jK1t'><q id='3jK1t'></q></dir></style></legend>
                        2. <tfoot id='3jK1t'></tfoot>
                          • <small id='3jK1t'></small><noframes id='3jK1t'>

                            主站蜘蛛池模板: 骨龄仪_骨龄检测仪_儿童骨龄测试仪_品牌生产厂家【品源医疗】 | 全自动贴标机-套标机-工业热风机-不干胶贴标机-上海厚冉机械 | 紧急泄压人孔_防爆阻火器_阻火呼吸阀[河北宏泽石化] | 超细|超微气流粉碎机|气流磨|气流分级机|粉体改性机|磨粉机|粉碎设备-山东埃尔派粉体科技 | 亚克力制品定制,上海嘉定有机玻璃加工制作生产厂家—官网 | 防火窗_耐火窗_防火门厂家_防火卷帘门-重庆三乐门业有限公司 | 小型数控车床-数控车床厂家-双头数控车床 | PE拉伸缠绕膜,拉伸缠绕膜厂家,纳米缠绕膜-山东凯祥包装 | 影合社-影视人的内容合作平台 | 预制直埋蒸汽保温管-直埋管道-聚氨酯发泡保温管厂家 - 唐山市吉祥保温工贸有限公司 | 深圳品牌设计公司-LOGO设计公司-VI设计公司-未壳创意 | 绿萝净除甲醛|深圳除甲醛公司|测甲醛怎么收费|培训机构|电影院|办公室|车内|室内除甲醛案例|原理|方法|价格立马咨询 | 玻璃钢罐_玻璃钢储罐_盐酸罐厂家-河北华盛节能设备有限公司 | 磁粉制动器|张力控制器|气胀轴|伺服纠偏控制器整套厂家--台灵机电官网 | 小型手持气象站-空气负氧离子监测站-多要素微气象传感器-山东天合环境科技有限公司 | 卫生纸复卷机|抽纸机|卫生纸加工设备|做卫生纸机器|小型卫生纸加工需要什么设备|卫生纸机器设备多少钱一台|许昌恒源纸品机械有限公司 | 冷凝水循环试验箱-冷凝水试验箱-可编程高低温试验箱厂家-上海巨为(www.juweigroup.com) | 全自动实验室洗瓶机,移液管|培养皿|进样瓶清洗机,清洗剂-广州摩特伟希尔机械设备有限责任公司 | 连续油炸机,全自动油炸机,花生米油炸机-烟台茂源食品机械制造有限公司 | 定量包装秤,吨袋包装称,伸缩溜管,全自动包装秤,码垛机器人,无锡市邦尧机械工程有限公司 | 流量卡中心-流量卡套餐查询系统_移动电信联通流量卡套餐大全 | 废水处理-废气处理-工业废水处理-工业废气处理工程-深圳丰绿环保废气处理公司 | 塑钢课桌椅、学生课桌椅、课桌椅厂家-学仕教育设备首页 | 窖井盖锯圆机_锯圆机金刚石锯片-无锡茂达金刚石有限公司 | 温州在线网| 打包箱房_集成房屋-山东佳一集成房屋有限公司| 升降机-高空作业车租赁-蜘蛛车-曲臂式伸缩臂剪叉式液压升降平台-脚手架-【普雷斯特公司厂家】 | Trimos测长机_测高仪_TESA_mahr,WYLER水平仪,PWB对刀仪-德瑞华测量技术(苏州)有限公司 | 创绿家招商加盟网-除甲醛加盟-甲醛治理加盟-室内除甲醛加盟-创绿家招商官网 | 菲希尔X射线测厚仪-菲希尔库伦法测厚仪-无锡骏展仪器有限责任公司 | 网站建设,北京网站建设,北京网站建设公司,网站系统开发,北京网站制作公司,响应式网站,做网站公司,海淀做网站,朝阳做网站,昌平做网站,建站公司 | 房车价格_依维柯/大通/东风御风/福特全顺/江铃图片_云梯搬家车厂家-程力专用汽车股份有限公司 | 禹城彩钢厂_钢结构板房_彩钢复合板-禹城泰瑞彩钢复合板加工厂 | 河南砖机首页-全自动液压免烧砖机,小型砌块水泥砖机厂家[十年老厂] | 青州开防盗门锁-配汽车芯片钥匙-保险箱钥匙-吉祥修锁店 | 工业机械三维动画制作 环保设备原理三维演示动画 自动化装配产线三维动画制作公司-南京燃动数字 聚合氯化铝_喷雾聚氯化铝_聚合氯化铝铁厂家_郑州亿升化工有限公司 | 世纪豪门官网 世纪豪门集成吊顶加盟电话 世纪豪门售后电话 | 作文导航网_作文之家_满分作文_优秀作文_作文大全_作文素材_最新作文分享发布平台 | 鼓风干燥箱_真空烘箱_高温干燥箱_恒温培养箱-上海笃特科学仪器 | 定坤静电科技静电消除器厂家-除静电设备 | 手机游戏_热门软件app下载_好玩的安卓游戏下载基地-吾爱下载站 |