Wednesday, December 29, 2010

Re: Problems Creating Shells (Tutorial)

> Go to /orders/add and add some
> orders to the database.

Hi, may I know does it mean going to app/views/orders/add.ctp

which is a file we need to manually create or does it auto-create ?

>Is your app called 'app' ?

I'm not sure what you mean, my root folder is named cakephp, in there
I have:
app (folder) <--here's where I put my codes
cake (folder)
plugins (folder)
vendors (folder)

.gitignore
.htaccess
index.php
README(FILE)


Maybe could you clarify if now my app folder is called app ? Is that
what you mean ?


Thans. Regards,
Maxim

On Dec 30, 2:26 am, John L <confidentia...@gmail.com> wrote:
> 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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: