warhead2020 Posted June 18, 2008 Share Posted June 18, 2008 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... Quote Link to comment Share on other sites More sharing options...
Barand Posted June 18, 2008 Share Posted June 18, 2008 enclose the values in {..}s values('{$satu[$i][$j]}','{$satu[$i][$j]}', etc Quote Link to comment Share on other sites More sharing options...
fenway Posted June 18, 2008 Share Posted June 18, 2008 enclose the values in {..}s values('{$satu[$i][$j]}','{$satu[$i][$j]}', etc Wow, you could acutally make sense of that code? Quote Link to comment Share on other sites More sharing options...
warhead2020 Posted June 19, 2008 Author Share Posted June 19, 2008 enclose the values in {..}s values('{$satu[$i][$j]}','{$satu[$i][$j]}', etc Thanks!Thanks!Thanks!.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.