PHP beginner |
|
Ik heb het nu zo; maar hij werkt niet:
<?php
$query = "
SELECT
SUM((IF(f.special == 1, f.price12, f.price1) * b.quantitysmall) + IF(f.special == 1, f.price22, f.price2) * b.quantitybig)) as totaalprijs
FROM
flowers f
INNER JOIN
payments b
ON
(f.id = b.flower_id)
WHERE
b.customer_id = ".$id."
AND
b.done = 0
AND
b.date = NOW()";
?>
<?php $query = " SELECT SUM((IF(f.special == 1, f.price12, f.price1) * b.quantitysmall) + IF(f.special == 1, f.price22, f.price2) * b.quantitybig)) as totaalprijs FROM flowers f INNER JOIN payments b ON (f.id = b.flower_id) WHERE b.customer_id = ".$id." AND b.done = 0 AND b.date = NOW()"; ?>
|