The problem was the setFlash function I'm using to debug! I've just
given the method a view of its own rather than setFlash to a redirect,
and the string outputs fine.... That never entered my mind...!

So the final function:

        function backup() {

                $this->redirect('/articles/index');

                //**** Send backup of Articles *****
                $sql_string = '';
                $db_records = $this->Article->findAll();

                foreach ($db_records as $article) {
                        $sql_string .= $this->Article->saveString($article);
                }

                $to      = '[EMAIL PROTECTED]';
                $subject = 'ciwy site articles backup';
                $message = wordwrap($sql_string, 70);
                $headers = 'From: [EMAIL PROTECTED]' . "\r\n" .
                        'Reply-To: [EMAIL PROTECTED]' . "\r\n";

                mail($to, $subject, $message, $headers);

...and do this for each database table you wish to back up.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to