Code: Select all
str_replaceTherefore, i think posting the prices over will not work. I'm going back to get the info from the db again. This time i'm trying to add the od_price_total to my tbl_order table. The only thing i've changed in my checkout-functions.php is from this code that used post and has the correct amount but wouldn't send due to the str_replace:
Code: Select all
$orderTotal = str_replace(',', '', $_POST['totalTotal']);
echo "orderTotal= $orderTotal";
return $orderTotal;Code: Select all
$orderTotal = 0;
$totalTotal = $_POST['totalTotal'];
$sql = "SELECT SUM('$totalTotal')
FROM tbl_order
WHERE od_id = $orderId";
$result = dbQuery($sql);
if (dbNumRows($result) == 1) {
$row = dbFetchRow($result);
$totalPurchase = $row[0];
$orderTotal = $totalPurchase;
echo "orderTotal= $orderTotal";
}
return $orderTotal;however, this code i replace it with only returns 2 from the db. ummmmmmm.....My table is as follows:
Code: Select all
CREATE TABLE `tbl_order` (
`od_id` int(10) unsigned NOT NULL auto_increment,
`member_username` varchar(30),
`od_date` datetime default NULL,
`od_last_update` datetime NOT NULL default '0000-00-00 00:00:00',
`od_status` enum('New', 'Paid', 'Shipped','Completed','Cancelled') NOT NULL default 'New',
`od_memo` varchar(255) NOT NULL default '',
`od_shipping_first_name` varchar(50) NOT NULL default '',
`od_shipping_last_name` varchar(50) NOT NULL default '',
`od_shipping_address1` varchar(100) NOT NULL default '',
`od_shipping_address2` varchar(100) NOT NULL default '',
`od_shipping_phone` varchar(32) NOT NULL default '',
`od_shipping_city` varchar(100) NOT NULL default '',
`od_shipping_state` varchar(32) NOT NULL default '',
`od_shipping_postal_code` varchar(10) NOT NULL default '',
`od_shipping_cost` decimal(5,2) default '0.00',
`od_vat` int(2) NOT NULL default '21',
`od_price_total` bigint NOT NULL default '',
`od_payment_first_name` varchar(50) NOT NULL default '',
`od_payment_last_name` varchar(50) NOT NULL default '',
`od_payment_address1` varchar(100) NOT NULL default '',
`od_payment_address2` varchar(100) NOT NULL default '',
`od_payment_phone` varchar(32) NOT NULL default '',
`od_payment_city` varchar(100) NOT NULL default '',
`od_payment_state` varchar(32) NOT NULL default '',
`od_payment_postal_code` varchar(10) NOT NULL default '',
PRIMARY KEY (`od_id`,`member_username`)
) TYPE=MyISAM AUTO_INCREMENT=1610 ;