This table works for the tutorial:
CREATE TABLE orders(
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
amount DEC(5,2),
created DATETIME,
shipped DATETIME
);
Then bake the model, controller and views. Go to /orders/add and add some
orders to the database. Assuming the cake command is in your PATH, cake
report should now work.
Well with one exception (maybe). I was getting this error: Notice undefined
variable: total in C:\...\vendors\shells\report.php on line 17
This line is the problem: $total += $order['Order']['amount'];
PHP won't accept this line if $total is not set
So my simple solution is:
if(!isset($total)){
$total = $order['Order']['amount'];
} else {
$total += $order['Order']['amount'];
}
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en