Hello, i have a quite weird error when doing a data insertion. The error is only occured on this section, when i do insert in other functions, it works fine.
Here's the bugged function:
public function checkoutAction(){
$cartID = $this->request->getQuery("id");
$mHTrans = new htransaction();
$sql2 = "INSERT INTO htransaction (cartID) VALUES ('$cartID')";
$mHTrans->getModelsManager()->executeQuery($sql2);
}
This will result in Notice: Cannot use a scalar value as an array in phalcon/mvc/model/query.zep on line 1823 in (my file) on line 119 Unknown expression
error.
Meanwhile, when i change the sql into INSERT INTO htransaction (cartID, financeStatus) VALUES ('$cartID', 'unconfirmed')
, the error becomes Fatal error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in (my file) on line 119
Here's the htransaction Model :
class htransaction extends Model{
public $hTransID;
public $cartID;
public $adminID;
public $dateAdded;
public $financeStatus;
public function initialize(){
$this->belongsTo("cartID", "cart", "cartID");
$this->belongsTo("adminID", "admin", "adminID");
}
}
Thanks in advance :D