I found similar queries similar to mine in stackoverflow, but did not find solutions. So I ask again. I have the following query insert:
$purchase_date = date("Y-m-d");
$init = substr($info[fname], 0, 2);
$odr = rand(0,255);
$invoice_number = $this->get_invoice_number();
//$invoice_number = $invoice_number+1;
//$invoice_number = 400 + rand(0,100);
$order_number = $init.'-'.$odr;
$session_id = session_id();
$sql = "
INSERT INTO
tbl_checkout
SET
fname = '$info[fname]',
lname = '$info[lname]',
email = '$info[email]',
phone = '$info[phone]',
address = '$info[address]',
pin = '$info[pin]',
session_id = '$session_id',
purchase_date = '$purchase_date',
invoice_number = '$invoice_number',
order_number = '$order_number' <----This is line no 1038
";
$this->db->insertQuery($sql);
But when I tried to execute it, it shows an error, for example Catchable fatal error: Object of class stdClass could not be converted to string in c:\.....on line 1038
I got lost because I can’t even understand what the error means! Please, help.
source
share