Welcome Guest, Not a member yet? Register   Sign In
Modifying Query Result Object
#5

[eluser]rfrancis[/eluser]
OK, so I'm feeling really dense on this one.

How do I loop through the result object, make modifications to it and keep it intact so I can forward it on to csv_from_result?

var_dump gives me the structure, but I can't figure out how to drill through that stucture.

Code:
array(30) {
    [0]=> object(stdClass)#16 (18)
        {
            ["SubjectID"]=> string(10) "1131754225"
            ["FirstName"]=> string(0) ""
            ["LastName"]=> string(0) ""
            ["GenderID"]=> string(1) "1"
            ["EthnicID"]=> string(1) "3"
            ["Children"]=> string(1) "1"
            ["DayPhone"]=> NULL
            ["EveningPhone"]=> NULL
            ["MobilePhone"]=> NULL
            ["Email"]=> NULL
            ["DOB"]=> NULL
            ["Occupation"]=> NULL
            ["IncomeID"]=> NULL
            ["Company"]=> NULL
            ["EducationID"]=> string(1) "6"
            ["City"]=> string(8) "Hilliard"
            ["StateID"]=> string(4) "Ohio"
            ["LastStudy"]=> NULL
         }
         etc through the results.

How do I drill through the result object to the individual fields? For example I need to modify EthnicID, how do I get to that value and modify it?


Messages In This Thread
Modifying Query Result Object - by El Forum - 04-17-2008, 10:48 PM
Modifying Query Result Object - by El Forum - 04-17-2008, 11:08 PM
Modifying Query Result Object - by El Forum - 04-18-2008, 05:23 PM
Modifying Query Result Object - by El Forum - 04-20-2008, 09:25 AM
Modifying Query Result Object - by El Forum - 04-24-2008, 09:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB