Link to home
Start Free TrialLog in
Avatar of leadcodev
leadcodev

asked on

PHP Array Insert into Mysql

I need to put the information in the array into a mysql table. Table1
$types = $rets->GetMetadataTypes();
      print_r($types);

This is what the output is. How do i loop through the array
inserting Resource and the value and the Data Elements and their values.

(
    [0] => Array
        (
            [Resource] => ActiveAgent
            [Data] => Array
                (
                    [0] => Array
                        (
                            [ClassName] => Agent
                            [VisibleName] => Agent
                            [StandardName] => Agent
                            [Description] => Active Agent
                            [TableVersion] => 01.03.02650
                            [TableDate] => Thu, 15 Jan 2015 03:07:39 GMT
                            [UpdateVersion] =>
                            [UpdateDate] =>
                        )

                )

        )

    [1] => Array
        (
            [Resource] => Office
            [Data] => Array
                (
                    [0] => Array
                        (
                            [ClassName] => Office
                            [VisibleName] => Office
                            [StandardName] => Office
                            [Description] => Office
                            [TableVersion] => 01.03.02650
                            [TableDate] => Thu, 15 Jan 2015 03:07:39 GMT
                            [UpdateVersion] =>
                            [UpdateDate] =>
                        )

                )

        )

    [2] => Array
        (
            [Resource] => Property
            [Data] => Array
                (
                    [0] => Array
                        (
                            [ClassName] => A
                            [VisibleName] => Residential Improved
                            [StandardName] => ResidentialProperty
                            [Description] => Residential Improved
                            [TableVersion] => 01.03.02650
                            [TableDate] => Thu, 15 Jan 2015 03:07:39 GMT
                            [UpdateVersion] =>
                            [UpdateDate] =>
                        )

                    [1] => Array
                        (
                            [ClassName] => C
                            [VisibleName] => Land
                            [StandardName] => LotsAndLand
                            [Description] => Land
                            [TableVersion] => 01.03.02650
                            [TableDate] => Thu, 15 Jan 2015 03:07:39 GMT
                            [UpdateVersion] =>
                            [UpdateDate] =>
                        )

                    [2] => Array
                        (
                            [ClassName] => D
                            [VisibleName] => Commercial/Industry
                            [StandardName] => CommonInterest
                            [Description] => Commercial/Industry
                            [TableVersion] => 01.03.02650
                            [TableDate] => Thu, 15 Jan 2015 03:07:39 GMT
                            [UpdateVersion] =>
                            [UpdateDate] =>
                        )

                )

        )

)
ASKER CERTIFIED SOLUTION
Avatar of mankowitz
mankowitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of leadcodev
leadcodev

ASKER

Actually I will be creating the table from the array from a webservice. Sorry I wasn't clear on that.  Any ideas on how to do that.
Setting up a dynamic process.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial