0

I'm trying to insert the values using PDO statement using ajax. but everytime it throws mysql error. something is missing!

$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();
Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98
shyamm
  • 506
  • 6
  • 17

1 Answers1

0

Looks like a simple issue of a typo. Should

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

be

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

instead?

chris g
  • 1,088
  • 10
  • 18