Wednesday, September 1, 2010

How to add multiple rows in one time ?

hi guys, i 've just met a terrible problem when i would like to copy
multiple data from one table and add those datas (which is have the
same foreign key) into another table in one time..
for example, firstly i want to copy the following data from table
'eating' :

array (
[Eating]=array
(
[0]=array
(
[people_id]=1
[food]=spagheti
)
[1]=array
(
[people_id]=1
[food]=burger
)
[2]=array
(
[people_id]=1
[food]=rice
)
)
)

from the copied data that shown above they are have the same
people_id..it means one person can eat some food..

after i copied those datas..i want to add them into another table
which have the same table structure...
i've tried to use 'for' looping to handle this problem..but seems it
didn't works..it saved just one row from the existing data..

are u guys know how to handle this problem?
need ur help soon
tq.

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: