How do I store an array into the database?
Here's the view:
echo $form->input('name');
echo $form->input('bio');
echo $form->input('book_id', array('multiple' => true));
What if I got multiple books? How do I store them in the database?
Whenever I tried saving the entry I get these errors:
Notice (8): Array to string conversion
Warning (512): SQL Error: 1054: Unknown column 'Array' in 'field list'
Query: INSERT INTO `authors` (`name`, `bio`, `book_id`) VALUES ('Chuck
Palahniuk', 'Great writer', Array)
I created the BookController using bake BTW.
Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---