I don't know what the problem is with the php Array. I have an Array (obtained from the database) Array (& nbsp; [0] & gt; 2 & nbsp; [testconment_id] & gt; 2 & nbsp; [1] & gt; & nbsp; [testconment_userid] & gt; & nbsp; [2] php array problems
I don't know what the problem is,
I have an array (retrieved from the database)
Array
(
[0] => 2
[Testconment_id] => 2
[1] =>
[Testconment_userid] =>
[2] => 2
[Testconment_testid] => 2
[3] =>
[Testconment_typeid] =>
[4] =>
[Testconment_flag] =>
[5] => Hello, ah
[Testconment_content] => Hello!
[6] => 05:25:03
[Testconment_date] => 05:25:03
)
Cyclic value
Foreach ($ commentList as $ v ){
$ CommentTemp ["id"] = $ v ["testconment_id"];
$ CommentTemp ["userid"] = $ v ["testconment_userid"];
$ CommentTemp ["testid"] = $ v ["testconment_testid"];
$ CommentTemp ["typeid"] = $ v ["testconment_typeid"];
$ CommentTemp ["flag"] = $ v ["testconment_flag"];
$ CommentTemp ["content"] = $ v ["testconment_content"];
$ CommentTemp ["date"] = $ v ["testconment_date"];
Array_push ($ commentArray, $ commentTemp );
}
I printed $ commentArray.
Array
(
[0] => Array
(
[Id] => 2
[Userid] => 2
[Testid] => 2
[Typeid] => 2
[Flag] => 2
[Content] => 2
[Date] => 2
)
[1] => Array
(
[Id] => 2
[Userid] => 2
[Testid] => 2
[Typeid] => 2
[Flag] => 2
[Content] => 2
[Date] => 2
)
[2] => Array
(
[Id] =>
[Userid] =>
[Testid] =>
[Typeid] =>
[Flag] =>
[Content] =>
[Date] =>
)
[3] => Array
(
[Id] =>
[Userid] =>
[Testid] =>
[Typeid] =>
[Flag] =>
[Content] =>
[Date] =>
)
[4] => Array
(
[Id] => 2
[Userid] => 2
[Testid] => 2
[Typeid] => 2
[Flag] => 2
[Content] => 2
[Date] => 2
)
[5] => Array
(
[Id] => 2
[Userid] => 2
[Testid] => 2
[Typeid] => 2
[Flag] => 2
[Content] => 2
[Date] => 2
)
[6] => Array
(
[Id] =>
[Userid] =>
[Testid] =>
[Typeid] =>
[Flag] =>
[Content] =>
[Date] =>
)
[7] => Array
(
[Id] =>
[Userid] =>
[Testid] =>