ISSUE
Hello, I have multiple PHP Arrays with multiple values that I am inserting to a SQL database from an XML file. Some of those values are an array on its own (Multi-dimensional array) but the value only gets stored as "Array", none of the sub-values get passed.
EXAMPLE ARRAY
[0] => Array
(
[A] => This is the Title
[B] => This is the Description
[C] => Array
(
[0] => Value 1
[1] => Value 2
[2] => Value 3
)
)
I have no problems inserting single values, so A and B will get inserted without a problem. But C will only get inserted as "Array".
INSERTION CODE
// This is the PHP array that contains multiple items
$Items
// There can be multiple Arrays in this XML so i have to loop through each one
foreach($Items as $Item => $value) {
$result = $mysqli->query("INSERT INTO database_name (A, B, C)
VALUES ('$value[A]', '$value[B]', '$value[C]');");
}
I want to serialize the [C] and put it in a single column. But if i do it in the foreach loop like this serialize("$value[C]") only "Array" gets passed to the value. I am a bit lost.
I will appreciate any help I can get.