Jump to content

[SOLVED] Insert Array 2 Dimensional Into Table


warhead2020

Recommended Posts

hello,im beginner in php. My problem is,I want to insert the value in my array into the database. Here is my coding.

 

-----------------------------------------------------------------------------------------------------

for($i=5;$i<=10;$i++)

{

for($j=1;$j<5;$j++)

{

$satu[$i][$j]=$j;

}

}

 

for($i=5;$i<=10;$i++)

{

for($j=1;$j<5;$j++)

{

$sql="insert into sampling_parameter(mp_fldKodStesen,mp_fldKodCourse,mp_fldWeek,mp_fldWeekActual,mp_fldKumpulan,mp_fldJenisParam,mp_fldBacaan,mp_fldResampling,mp_fldCreTime) values('$satu[$i][$j]','$satu[$i][$j]','$satu[$i][$j]','$satu[$i][$j]','$satu[$i][$j]','$satu[$i][$j]','$satu[$i][$j]','$satu[$i][$j]','$satu[$i][$j]')";

mysql_query($sql);

}

}

 

 

----------------------------------------------------------------------------------------------------

 

The problem here,it is not the value in the array that are inserted into the column. It works if I use array 1 dimensional. Hope someone out there can understand my question and help me solve this problem. Thanks In advance...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.