Monday, February 28, 2011

Re: Can't Save to DB

So I know this isn't strictly speaking CakePHP anymore and just basic php, but I'm having difficulty getting it into the correct CakePHP format, so I think it counts.
Here's the for loop I'm using to get it into the correct format (just in testing phase, it print_r's all the results):
foreach($episodes as $key => $value) {
$episode['Episode'][$key] = $value;
print_r($episode);
}
But the problem is, it gives me one array too many (the [0] array):
Array
(
[Episode] => Array
(
[0] => Array
(
[name] => The Prestidigitation Approximation
[number] => 18
[description] => Sheldon is baffled by Wolowitz's magic trick. Meanwhile, Leonard realizes dating Priya may make it impossible to continue being friends with Penny.
[date] => 3/10/2011
[show_id] => 11
)
)
)
I can't find the part in my code that adds that extra array. Any suggestions?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
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

No comments: