I'm trying to store the 2 array values in single row. However, I got unexpected output which return extra row in the datatable.
My php:
$checkbox1=$_POST['name'];
$checkbox2=$_POST['id'];
foreach ($checkbox1 as $pop )
{
$addsql = "insert into referral () values ('$pop','{$_POST['id']}')";
$addresult = mysql_query($addsql, $link);
}
My table (ERROR):
Name ID
Alex Array
1 Array
Alice Array
2 Array
Expected Result:
Name ID
Alex 1
Alice 2