Yii Framework Forum: Insert Multi Row - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Insert Multi Row memasukkan data multi sekaligus Rate Topic: -----

#1 User is offline   budi joe 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 15-August 13

Posted 15 August 2013 - 11:20 PM

maaf agan2, saya nubi
saya punya data 2 dimensi untuk data presensi siswa SD tiap bulan, tablesnya:

bulan: id_bulan, nama_bulan
data: id_bulan,tahun,kelas1,kelas2,kelas3,kelas4,kelas5,kelas6

untuk view createnya sudah saya bikin tampilan seperti ini

bln | kelas1| kelas2 | kelas3 | kelas4 | kelas5 | kelas6
jan
feb
mar
apr
mei
jun
jul
aug
sep
okt
nov
des
[SIMPAN]

saya cari di yii 1.14 ada fungsi baru
$builder=Yii::app()->db->schema->commandBuilder;
$command=$builder->createMultipleInsertCommand('tbl_post', array(
  array('title' => 'record 1', 'text' => 'text1'),
  array('title' => 'record 2', 'text' => 'text2'),
));
$command->execute();

Bagaimana cara membuat array 2 dimensi di views dan di controller (pada kasus diatas)? saya coba2 tapi belum bisa
*mohon bimbingannya
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users