Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

I have code to insert data. but shows an error

I have code to insert data. but shows an error "Recoverable fatal error: Object of class PDOStatement could not be converted to string in E:\xampp\htdocs\atiq\New-Project\ButtonTexMine\add-order.php on line 39"

   <?php
require_once("config.php");
if (!isset($_SESSION["user_id"]) || $_SESSION["user_id"] == "") {
    // not logged in send to login page
    redirect("index.php");
}


$a = $_POST['date'];
$b = $_POST['party_name'];
$c = $_POST['party_address'];
$d = $_POST['party_ref'];
$e = $_POST['won'];
$f = $_POST['woof'];
$g = $_POST['button_line'];
$h = $_POST['button_hole'];
$i = $_POST['button_type'];
$j = $_POST['logo_button'];
$k = $_POST['quantity'];
$l = $_POST['rate'];
$m = $_POST['amount'];
$n = $_POST['revised_date'];
$o = $_POST['revised_amount'];
$p = $_POST['pro_in_no'];
$q = $_POST['pro_in_date'];
$r = $_POST['cash_bill_no'];
$s = $_POST['lc_sl_no'];
$t = $_POST['lc_no'];
$u = $_POST['lc_date'];
$v = $_POST['total_amount'];
$w = $_POST['pay_amount'];
$x = $_POST['due'];
$y = $_POST['mode'];
$z = 'Store Processing';


$sql = "INSERT INTO orders (date, party_name, party_address, party_ref, work_order_no, work_order_off, button_line, button_hole, button_type, logo_button, quantity, rate, amount, revised_date, revised_amount, pro_in_no, pro_in_date, cash_bill_no, lc_sl_no, lc_no, lc_date, total_amount, pay_amount, due, mode, status) VALUES (:a, :b, :c, :d, :e, :f, :g, :h, :i, :j, :k, :l, :m, :n, :o, :p, :q, :r, :s, :t, :u, :v, :w, :x, :y, :z)";
$q = $DB->prepare($sql);
$q->execute(array(':a'=>$a,':b'=>$b,':c'=>$c,':d'=>$d,':e'=>$e,':f'=>$f,':g'=>$g,':h'=>$h,':i'=>$i,':j'=>$j,':k'=>$k,':l'=>$l,':m'=>$m,':n'=>$n,':o'=>$o,':p'=>$p,':q'=>$q,':r'=>$r,':s'=>$s,':t'=>$t,':u'=>$u,':v'=>$v,':w'=>$w,':x'=>$x,':y'=>$y,':z'=>$z));
header("location: orders.php");


?>

Comments