i am try to insert Associative array in database which recieve it from ajax file . and when print it in console it be like {name: "name", number: "5"} .
$services_array = explode(',' ,$_REQUEST['services_array'] );
foreach ($services_array as $name => $quantity ) {
$add_data = $engine->connect()->query("INSERT IGNORE INTO `requests` SET
`section` = '$name',
`quantity` = '$quantity '
");
}
the problem is in database the field of section the data in it be 0 or 1 or 2 and in field of quantity the data in it be [object Object]