SELECT `shop2_orders`.`id`, UNIX_TIMESTAMP(`time`) AS `time`,CEIL(`totalCost`*(1-`percentageDiscount`/100)+`postalCharge`) AS `total` FROM `shop2_orders` LEFT JOIN `shop2_carts` ON (`shop2_orders`.`id` = `shop2_carts`.`order`) WHERE `user` = '