SQLSTATE [HY093]:参数号无效:参数未定义PDO

时间:2017-01-25 07:02:52

标签: php mysql pdo

我尝试使用ajax使用PDO语句插入值。但每次它抛出mysql错误。缺少一些东西!

$st = $pdo->prepare('INSERT INTO payment_tbl (user_id, payment_mode, bank_name, cheque_no, pending_amt) 
       VALUES(  :user_id, :payment_mode, :bank_name, :cheque_no, :pending_amt )');


 $st->bindParam('user_id' , $user_id);
 $st->bindParam('payment_mode' , $pmode1);
 $st->bindParam('bank_name' , $bank_name1);
 $st->bindParam('cheque_no' , $cheque_no1);
 $st->bindParam('paid_amt' , $paid_amt1);

 $st->execute();

1 个答案:

答案 0 :(得分:0)

看起来像是一个错字的简单问题。应

    $st->bindParam('paid_amt' , $paid_amt1);

    $st->bindParam('pending_amt' , $pending_amt);

代替?