im trying to print_r my code array :
$arr = Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 10 )
so, how i can get this value to insert to database? because when i submit always error Array to string conversion
<?php
if (isset($_POST['cmdSubmitAspek']))
{
$nilaiBobot = $_POST['nilaiBobot'];
$arr = $_POST['arr'];
foreach($_POST['nilaiBobot'] as $key => $value ){
$nilaiBobotTenp = $nilaiBobot[$key];
$arr = $arr[$key];
$queryInsAspek = "insert into skalaPrioritas (idDivisi, idDepartment, arr, nilaiBobot, submitBy, inputDT)
VALUES ".$idDivisi.", ".$idDepartment.", '".$arr."','".$nilaiBobotTenp."',".$userID.", getdate()";
$resultInsAspek = sqlsrv_query($conn, $queryInsAspek);
}
}