doulun5683 2019-03-05 18:16
浏览 116

无法解决此错误:参数号无效:绑定变量数与令牌数不匹配

I'm getting this invalid parameter number error, even though I have exactly two bound variables and two tokens, I only need to insert those two values so I entered the rest of the columns as null. Here it is

connecting::query('INSERT INTO accounts VALUES (null,null,null,\'0\',null,null,:something,null,null,null,null,null,null:somethingElse,null,null)', array(':social'=>$social,':noise'=>$noise));

Here's the method being called:

public static function query($query,$params = array())
    {


        $statement = self :: db()->prepare($query);
        $statement->execute($params);
        if(explode(' ',$query)[0] == 'SELECT')
        {
            $data = $statement->fetchAll();
            return $data;
        }

    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 overleaf中论文编辑,报错`pages' is a missing field, not a string, for entry 4
    • ¥15 vhdl+MODELSIM
    • ¥20 simulink中怎么使用solve函数?
    • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
    • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
    • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
    • ¥15 知识蒸馏实战博客问题
    • ¥15 用PLC设计纸袋糊底机送料系统
    • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
    • ¥15 用C语言输入方程怎么