![]() |
calendarcustomfields options field into array
I'm wondering how i extract all the custom options from the table field options in the calendarcustomfields table.
When i look in the database all the custom options seem to be stored in one field in a format that looks like indexes or an array or something. How do i extract each value and put it into an array using php and mysql? I know how to query the database but i don't know how to seperate those values in that field. For example, i want to take the data in that field... a:6:{i:1;s:3:"Gig";i:2;s:10:"Club Night";i:3;s:10:"Networking";i:4;s:7:"Lecture";i:5 ;s:7:"Seminar";i:6;s:5:"Other" ;} and put it into an array... Gig night Networking Lecture Seminar Other Any help on this would be greatfully appreciated. Thanks |
Use unserialize($yourdata);
|
So I'd pull that field data into a variable called $yourdata and then use unserialize on it?
Thanks! |
Yes - use print_r() to test the output and (using your example) you should see the following:
Array ( [1] => Gig [2] => Club Night [3] => Networking [4] => Lecture [5] => Seminar [6] => Other ) |
Thanks Mark, that helps a lot :)
KJ |
All times are GMT. The time now is 02:18 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|