Code:
$album = new Albums();
$album->name = 'The One';
$album->artist = $artist;
$songs = array();
// Create a first song
$songs[0] = new Songs();
$songs[0]->name = 'Star Guitar';
$songs[0]->duration = '5:54';
// Create a second song
$songs[1] = new Songs();
$songs[1]->name = 'Last Days';
$songs[1]->duration = '4:29';
// Assign the songs array
$album->songs = $songs;
// Save the album + its songs
$album->save();
- The above example works for x64/VC9/TS/PHP5.4.12 (Winodws7+WAMP)
- However this breaks for x86/VC9/NTS/PHP5.4.42(Windows +IIS8)
I tried connecting WAMP to remote MySQL and the above code works fine.