Hello,
Is it possible to do this
<?php $amount = '{embed="control_panel/home_price" primary="true"}'; ?>in a template with PHP set to output?
When I echo the $amount I get the correct result but if I try to:
<?php
echo $amount; //here it echoes the price
$sql = "INSERT INTO shop_validation (date_entered,merchant_ref,merchant_id,amount,currency_code) VALUES(UNIX_TIMESTAMP(now()),'$mref','2388',$amount,'0978')";
$query = $this->EE->db->query($sql);
?>The $amount is replaced with the embed tag
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '="control_panel/home_price" primary="true"},'0978')' at line 1
INSERT INTO shop_validation (date_entered,merchant_ref,merchant_id,amount,currency_code) VALUES(UNIX_TIMESTAMP(now()),'1160_1322916759','2388',{embed="control_panel/home_price" primary="true"},'0978')What am I doing wrong? Is it the parse order? Are there any alternatives?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.