My mistakes

Archive for December 2009

Loops and save()

You must reset the Model on every loop iteration.
$this->{ Model Name } ->create();

Place the above line at the beginning of the loop for eg:

foreach() {
$this->{ Model Name } ->create();
/* actual code */
}

Replace the { Model Name } with the corresponding model name

Tags:

XML Error: XML declaration not finished at line 1

This error can occur in either one of these two situations…

1. Your server does not support UTF-8 encoding;
OR
2. You have incorrect magic_quotes settings on your server.

To check your server settings
Create a php file and place the below lines in it

For working with the second problem magic_quote settings should be:

magic_quotes_gpc ON
magic_quotes_runtime OFF (same as the PHP default setting)
magic_quotes_sybase OFF (same as the PHP default setting)

Tags: