Welcome Guest, Not a member yet? Register   Sign In
Unserialize data for inclusion in a csv string
#3

[eluser]carvingCode[/eluser]
>> Is it possible to unserialize the data of 4 fields (thursday, friday, saturday, sunday) with how it is set up now?

Don't know if you've solved this yet.

To unserialize a array element (which is what's coming out of the query, you've got to get to the element.

Before passing the result to the csv method, I would break the query result up into its components (use foreach to loop through), perform the unserialize function on the appropriate fields and store it back into the field. Then, pass the array to the csv function.

Code:
foreach ($query as $key => $value) {
  if ($key == 'matches one of your field locations') {
    $value = unserialize($value);
  }
}

Now pass $query to the csv function as normal.

Hope this helps.


Messages In This Thread
Unserialize data for inclusion in a csv string - by El Forum - 02-08-2011, 09:55 PM
Unserialize data for inclusion in a csv string - by El Forum - 02-08-2011, 10:08 PM
Unserialize data for inclusion in a csv string - by El Forum - 04-22-2011, 11:21 AM
Unserialize data for inclusion in a csv string - by El Forum - 04-22-2011, 11:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB