I have an array that returns:
Array (
[0] => stdClass Object (
[webinarKey] => 635595402
[subject] => Messages
[description] => This webinar is open to practicing clinicians only. If not a practicing
clinician, seek permission from Sun Nuclear prior to registering. Any views, findings, or
recommendations expressed in this presentation are solely those of the guest speaker, and do
not necessarily represent those held by Sun Nuclear. Please contact Sun Nuclear to verify any
claims or request further information.
[organizerKey] => 1.0000000000131E+17
[times] => Array (
[0] => stdClass Object (
[startTime] => 2014-11-21T14:00:00Z
[endTime] => 2014-11- 21T15:00:00Z )
)
[timeZone] => America/New_York
)
How can I select [subject] and [description] and insert the data into a database table?
Try like
$array = get_object_vars($your_data);
$subject = $array['subject'];
$description = $array['description'];
Then you can save those variables to your db etc.
You can do a foreach()
$subject = '';
$description = '';
foreach($array as $item){
$subject = $item->subject;
$description = $item->description;
// Save it into the db or store it into a variable to save after the loop ends
}