Programming 板


LINE

不好意思,不确定是PO在这里还是PHP版或DB版,若PO错请版主通知小弟转版,谢谢您 因为小弟工作上的关系,需要维公司的网站,最近在进行平台移转时,後台在做写入DB时 会出现错误,错误讯息如下: <b>Fatal error</b>: Uncaught exception 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli statement execute error : No data supplied for parameters in prepared statement' in /home/oringnet/public_html/website/library/Zend/Db/Statement/Mysqli.php:218 Stack trace: #0 /home/oringnet/public_html/website/library/Zend/Db/Statement.php(284): Zend_Db_Statement_Mysqli-&gt;_execute(Array) #1 /home/oringnet/public_html/website/library/Zend/Db/Adapter/Abstract.php(436): Zend_Db_Statement-&gt;execute(Array) #2 /home/oringnet/public_html/website/library/Zend/Db/Adapter/Abstract.php(566): Zend_Db_Adapter_Abstract-&gt;query('UPDATE `product...', Array) #3 /home/oringnet/public_html/website/library/Zend/Db/Table/Abstract.php(962): Zend_Db_Adapter_Abstract-&gt;update('product_switch_...', Array, 'sn = 139') #4 /home/oringnet/public_html/website/library/Jasmin/Model/Abstract.php(903): Zend_Db_Table_Abstract-&gt;update(Array, 'sn = 139') #5 /home/oringnet/public_html/website/application/workbench/controllers/ProductController.php(352): Jasmin_Model_Abstrac in <b>/home/oringnet/public_html/website/library/Zend/Db/Statement/Mysqli.php</b> on line <b>218</b><br /> 因为小弟是PHP的新手,再翻遍估狗搜来的相关网页皆没看到相关的解决办法,故只好上 来相询请教, 已经查询过出错误的程式码 Zend/Db/Statement/Mysqli.php 218行如下 throw new Zend_Db_Statement_Mysqli_Exception("Mysqli statement execute error : " . $this->_stmt->error); 而整段function则为: public function _execute(array $params = null) { if (!$this->_stmt) { return false; } // if no params were given as an argument to execute(), // then default to the _bindParam array if ($params === null) { $params = $this->_bindParam; } // send $params as input parameters to the statement if ($params) { array_unshift($params, str_repeat('s', count($params))); call_user_func_array( array($this->_stmt, 'bind_param'), $params ); } // execute the statement //var_dump($this->_stmt); $retval = $this->_stmt->execute(); if ($retval === false) { /** * @see Zend_Db_Statement_Mysqli_Exception */ require_once 'Zend/Db/Statement/Mysqli/Exception.php'; throw new Zend_Db_Statement_Mysqli_Exception("Mysqli statement execute error : " . $this->_stmt->error); } // retain metadata if ($this->_meta === null) { $this->_meta = $this->_stmt->result_metadata(); if ($this->_stmt->errno) { /** * @see Zend_Db_Statement_Mysqli_Exception */ require_once 'Zend/Db/Statement/Mysqli/Exception.php'; throw new Zend_Db_Statement_Mysqli_Exception("Mysqli statement metadata error: " . $this->_stmt->error); } } // statements that have no result set do not return metadata if ($this->_meta !== false) { // get the column names that will result $this->_keys = array(); foreach ($this->_meta->fetch_fields() as $col) { $this->_keys[] = $this->_adapter->foldCase($col->name); } // set up a binding space for result variables $this->_values = array_fill(0, count($this->_keys), null); // set up references to the result binding space. // just passing $this->_values in the call_user_func_array() // below won't work, you need references. $refs = array(); foreach ($this->_values as $i => &$f) { $refs[$i] = &$f; } $this->_stmt->store_result(); // bind to the result variables call_user_func_array( array($this->_stmt, 'bind_result'), $this->_values ); } return $retval; } 有趣的是,select都没问题,显示正常,但在做新增及修改时的储存都会出现相同的错误 讯息, 不过insert时Exception会抓到错误而跳出对话框讯息,做update时则会直接出现开头 的错误讯息页面。 以小弟的皮毛功力实在无法解决,还请前辈们可以帮下小弟,在此先说声谢谢了。 平台伺服器资讯 Apache版本2.4.10 MySQL版本5.5.37-cll PHP版本5.3.29 --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 122.116.43.168
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Programming/M.1414398823.A.078.html
1F:→ MOONRAKER: 同学你犯了framework user最基本的错误 122.116.43.189 10/27 21:52
2F:→ MOONRAKER: 不要帮framework的code除错 122.116.43.189 10/27 21:52
3F:→ MOONRAKER: 人家千锤百链的code,有错绝难由你发现 122.116.43.189 10/27 21:53
4F:→ MOONRAKER: 一开始就跟你说 no data supplied for 122.116.43.189 10/27 21:54
5F:→ MOONRAKER: parameters in prepared statement了 122.116.43.189 10/27 21:54
6F:→ MOONRAKER: 你就老老实实去检查准备要写入db的那一 122.116.43.189 10/27 21:56
7F:→ MOONRAKER: 包物件或阵列里面有什麽东东 122.116.43.189 10/27 21:56
8F:→ MOONRAKER: 努力把它找到,你就可以累积经验值。 122.116.43.189 10/27 21:58
9F:→ carylorrk: 都是 they 的错 1.34.244.41 10/28 02:30
10F:→ nightsmile: 感谢M大,所以我应该是从呼叫这个 122.116.43.168 10/28 08:49
11F:→ nightsmile: 函数的客制程式ProductController.php 122.116.43.168 10/28 08:50
12F:→ nightsmile: 开始除错是吗? 122.116.43.168 10/28 08:51
13F:→ nightsmile: 可是有疑问的是,整套系统在原来的平 122.116.43.168 10/28 08:56
14F:→ nightsmile: 台上执行都正常,但换个地方就水土不 122.116.43.168 10/28 08:57
15F:→ nightsmile: 服...囧,而小弟完全只会hello world. 122.116.43.168 10/28 08:59
16F:→ MOONRAKER: 或许是Zend framework的版本问题 122.116.43.189 10/28 13:06
17F:→ MOONRAKER: 这的确很难查 122.116.43.189 10/28 13:06
18F:→ nightsmile: 感谢M大给的方向,今日冒着网站挂掉被 122.116.43.168 10/28 15:10
19F:→ nightsmile: 骂的风险,将framework升级,结果问题 122.116.43.168 10/28 15:10
20F:→ nightsmile: 解决了~再次感谢M大~ 122.116.43.168 10/28 15:12
21F:推 MOONRAKER: 哈哈有解决就好 122.116.43.189 10/28 20:20
22F:→ MOONRAKER: 没想到问题最後真的来自framework 122.116.43.189 10/28 20:20
23F:→ MOONRAKER: 这对我也是个教训 122.116.43.189 10/28 20:20







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:BuyTogether站内搜寻

TOP