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

  1. <tfoot id='MFy6E'></tfoot>

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

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

      Mysqli 拋出“警告:mysqli_stmt_bind_param() 期望參數

      Mysqli throws quot;Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean givenquot;(Mysqli 拋出“警告:mysqli_stmt_bind_param() 期望參數 1 為 mysqli_stmt,給出布爾值;) - IT屋-程序員軟件開發技
      <legend id='yHVkr'><style id='yHVkr'><dir id='yHVkr'><q id='yHVkr'></q></dir></style></legend>
      <tfoot id='yHVkr'></tfoot>

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

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

            <tbody id='yHVkr'></tbody>

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

                本文介紹了Mysqli 拋出“警告:mysqli_stmt_bind_param() 期望參數 1 為 mysqli_stmt,給出布爾值";的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我知道此代碼在我擁有的另一個網站上有效,但今天無法正常運行.我收到三個警告:

                I know that this code works on another site I've got but it's not playing ball today. I get three warnings:

                警告:mysqli_stmt_bind_param() 期望參數 1 為 mysqli_stmt,布爾值在/homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php 第 33 行

                Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in /homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php on line 33

                警告:mysqli_execute() 期望參數 1 為 mysqli_stmt,布爾值在/homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php 第 34 行

                Warning: mysqli_execute() expects parameter 1 to be mysqli_stmt, boolean given in /homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php on line 34

                警告:mysqli_stmt_affected_rows() 期望參數 1 為 mysqli_stmt,布爾值在/homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php 第 35 行

                Warning: mysqli_stmt_affected_rows() expects parameter 1 to be mysqli_stmt, boolean given in /homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php on line 35

                有人能幫我解決這個問題嗎?

                Can someone help me figure this out?

                如果有幫助,我必須使用 htaccess 升級到 PHP5.

                I am having to use htaccess to upgrade to PHP5 if this helps.

                $connection = mysqli_connect($hostname, $username, $password, $dbname);
                
                if (!$connection) {
                    die('Connect Error: ' . mysqli_connect_error());
                }
                
                $query = "INSERT INTO entries (name, dob, school, postcode, date) VALUES (?,?,?,?,?)";
                $stmt1 = mysqli_prepare($connection, $query);
                mysqli_stmt_bind_param($stmt1, 'sssss',$name,$dob,$school,$postcode,$date);
                mysqli_execute($stmt1);
                if(mysqli_stmt_affected_rows($stmt1) != 1)
                    die("issues");
                mysqli_stmt_close($stmt1);
                return "new";
                

                編輯

                經過一些調查發現,prepare 語句與 mysql4 不起作用.我創建了一個新的 mysql5 數據庫,但是當我嘗試連接時出現此錯誤:

                After some investigation it transpires that the prepare statement doesn't play ball with mysql4. I have created a new mysql5 database but I now get this error when I try to connect:

                Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'localhost:/tmp/mysql5.sock' (1)

                Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'localhost:/tmp/mysql5.sock' (1)

                有人知道為什么會這樣嗎?

                Does anyone have any idea as to why this is happening?

                推薦答案

                添加更多錯誤處理.
                當連接失敗時,mysqli_connect_error() 可以告訴你更多細節.
                當準備語句失敗時,mysqli_error() 有關于錯誤的更多信息.
                當語句執行失敗時,詢問mysqli_stmt_error().等等等等...
                任何時候 mysqli 模塊的函數/方法返回 false 以指示錯誤,a) 處理該錯誤和 b) 決定繼續是否有意義.例如.連接失敗時繼續進行數據庫操作是沒有意義的.但是當只有一次插入失敗時繼續插入數據可能是有意義的(可能有意義,可能沒有).

                Add more error handling.
                When the connection fails, mysqli_connect_error() can tell you more details.
                When preparing the statement fails mysqli_error() has more infos about the error.
                When executing the statement fails, ask mysqli_stmt_error(). And so on and on...
                Any time a function/method of the mysqli module returns false to indicate an error, a) handle that error and b) decide whether it makes sense or not to continue. E.g. it doesn't make sense to continue with database operations when the connection failed. But it may make sense to continue inserting data when just one insertion failed (may make sense, may not).

                為了測試,你可以使用這樣的東西:

                For testing you can use something like this:

                $connection = mysqli_connect(...);
                if ( !$connection ) {
                  die( 'connect error: '.mysqli_connect_error() );
                }
                
                $query = "INSERT INTO entries (name, dob, school, postcode, date) VALUES (?,?,?,?,?)";
                $stmt1 = mysqli_prepare($connection, $query);
                if ( !$stmt1 ) {
                  die('mysqli error: '.mysqli_error($connection);
                }
                mysqli_stmt_bind_param($stmt1, 'sssss',$name,$dob,$school,$postcode,$date);
                if ( !mysqli_execute($stmt1) ) {
                  die( 'stmt error: '.mysqli_stmt_error($stmt1) );
                }
                ...
                

                對于真正的生產環境,這種方法很健談,而且很容易死掉;-)

                For a real production environment this approach is to talkative and dies to easily ;-)

                這篇關于Mysqli 拋出“警告:mysqli_stmt_bind_param() 期望參數 1 為 mysqli_stmt,給出布爾值";的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 中保持其類型?)
                  • <tfoot id='phcnD'></tfoot>
                  • <legend id='phcnD'><style id='phcnD'><dir id='phcnD'><q id='phcnD'></q></dir></style></legend>
                    <i id='phcnD'><tr id='phcnD'><dt id='phcnD'><q id='phcnD'><span id='phcnD'><b id='phcnD'><form id='phcnD'><ins id='phcnD'></ins><ul id='phcnD'></ul><sub id='phcnD'></sub></form><legend id='phcnD'></legend><bdo id='phcnD'><pre id='phcnD'><center id='phcnD'></center></pre></bdo></b><th id='phcnD'></th></span></q></dt></tr></i><div class="fzhjzrn" id='phcnD'><tfoot id='phcnD'></tfoot><dl id='phcnD'><fieldset id='phcnD'></fieldset></dl></div>
                  • <small id='phcnD'></small><noframes id='phcnD'>

                        <tbody id='phcnD'></tbody>
                        <bdo id='phcnD'></bdo><ul id='phcnD'></ul>

                          主站蜘蛛池模板: PC构件-PC预制构件-构件设计-建筑预制构件-PC构件厂-锦萧新材料科技(浙江)股份有限公司 | 暖气片十大品牌厂家_铜铝复合暖气片厂家_暖气片什么牌子好_欣鑫达散热器 | 诺冠气动元件,诺冠电磁阀,海隆防爆阀,norgren气缸-山东锦隆自动化科技有限公司 | 塑料瓶罐_食品塑料瓶_保健品塑料瓶_调味品塑料瓶–东莞市富慷塑料制品有限公司 | 防爆暖风机_防爆电暖器_防爆电暖风机_防爆电热油汀_南阳市中通智能科技集团有限公司 | 蜘蛛车-登高车-高空作业平台-高空作业车-曲臂剪叉式升降机租赁-重庆海克斯公司 | 有福网(yofus.com)洗照片冲印,毕业聚会纪念册相册制作个性DIY平台 | 防水套管-柔性防水套管-刚性防水套管-上海执品管件有限公司 | 玉米深加工设备|玉米加工机械|玉米加工设备|玉米深加工机械-河南成立粮油机械有限公司 | 金属管浮子流量计_金属转子流量计厂家-淮安润中仪表科技有限公司 | 有机肥设备生产制造厂家,BB掺混肥搅拌机、复合肥设备生产线,有机肥料全部加工设备多少钱,对辊挤压造粒机,有机肥造粒设备 -- 郑州程翔重工机械有限公司 | 武汉宣传片制作-视频拍摄-企业宣传片公司-武汉红年影视 | 诗词大全-古诗名句 - 古诗词赏析 | 宿松新闻网 宿松网|宿松在线|宿松门户|安徽宿松(直管县)|宿松新闻综合网站|宿松官方新闻发布 | 细沙回收机-尾矿干排脱水筛设备-泥石分离机-建筑垃圾分拣机厂家-青州冠诚重工机械有限公司 | 螺杆真空泵_耐腐蚀螺杆真空泵_水环真空泵_真空机组_烟台真空泵-烟台斯凯威真空 | 撕碎机_轮胎破碎机_粉碎机_回收生产线厂家_东莞华达机械有限公司 | 北京办公室装修,办公室设计,写字楼装修-北京金视觉装饰工程公司 北京成考网-北京成人高考网 | 购买舔盐、舔砖、矿物质盐压块机,鱼饵、鱼饲料压块机--请到杜甫机械 | 钢丝绳探伤仪-钢丝绳检测仪-钢丝绳探伤设备-洛阳泰斯特探伤技术有限公司 | 高硼硅玻璃|水位计玻璃板|光学三棱镜-邯郸奥维玻璃科技有限公司 高温高压釜(氢化反应釜)百科 | 储气罐,真空罐,缓冲罐,隔膜气压罐厂家批发价格,空压机储气罐规格型号-上海申容压力容器集团有限公司 | 施工电梯_齿条货梯_烟囱电梯_物料提升机-河南大诚机械制造有限公司 | 动库网动库商城-体育用品专卖店:羽毛球,乒乓球拍,网球,户外装备,运动鞋,运动包,运动服饰专卖店-正品运动品网上商城动库商城网 - 动库商城 | 办公室装修_上海办公室设计装修_时尚办公新主张-后街印象 | 济南冷库安装-山东冷库设计|建造|冷库维修-山东齐雪制冷设备有限公司 | 冷库安装厂家_杭州冷库_保鲜库建设-浙江克冷制冷设备有限公司 | 四探针电阻率测试仪-振实密度仪-粉末流动性测定仪-宁波瑞柯微智能 | 【甲方装饰】合肥工装公司-合肥装修设计公司,专业从事安徽办公室、店面、售楼部、餐饮店、厂房装修设计服务 | 运动木地板_体育木地板_篮球馆木地板_舞台木地板-实木运动地板厂家 | 采暖炉_取暖炉_生物质颗粒锅炉_颗粒壁炉_厂家加盟批发_烟台蓝澳采暖设备有限公司 | 货车视频监控,油管家,货车油管家-淄博世纪锐行电子科技 | 艺术涂料|木纹漆施工|稻草漆厂家|马来漆|石桦奴|水泥漆|选加河南天工涂料 | 航空障碍灯_高中低光强航空障碍灯_民航许可认证航空警示灯厂家-东莞市天翔航天科技有限公司 | IIS7站长之家-站长工具-爱网站请使用IIS7站长综合查询工具,中国站长【WWW.IIS7.COM】 | 环氧乙烷灭菌器_压力蒸汽灭菌器_低温等离子过氧化氢灭菌器 _低温蒸汽甲醛灭菌器_清洗工作站_医用干燥柜_灭菌耗材-环氧乙烷灭菌器_脉动真空压力蒸汽灭菌器_低温等离子灭菌设备_河南省三强医疗器械有限责任公司 | 诺冠气动元件,诺冠电磁阀,海隆防爆阀,norgren气缸-山东锦隆自动化科技有限公司 | 炉门刀边腹板,焦化设备配件,焦化焦炉设备_沧州瑞创机械制造有限公司 | 北京公司注册_代理记账_代办商标注册工商执照-企力宝 | 急救箱-应急箱-急救包厂家-北京红立方医疗设备有限公司 | 提升海外网站流量,增加国外网站访客UV,定制海外IP-访客王 |