Forums

Update Options Inserting Array Incorrectly (1 post)

  1. tracyfu
    Member
    Posted 4 years ago #

    I wrote a plugin that inserts a music playlist as an array of multiple associative arrays. For most people it seems to be working, but there are a few for which it inserts the correct array, but the data is coming back as capital "A's."

    So, instead of this:

    (
    [default] => Array
    (
    [1] => Array
    (
    [artist] => Feist
    [title] => My Moon My Man
    [file] => http://www.tracyfu.com/projects/wordphonic/mp3s/01.mp3
    [image] => http://www.tracyfu.com/projects/wordphonic/images/01.png
    )

    [2] => Array
    (
    [artist] => Lovage
    [title] => Stroker Ace
    [file] => http://www.tracyfu.com/projects/wordphonic/mp3s/02.mp3
    [image] => http://www.tracyfu.com/projects/wordphonic/images/02.png
    )

    [3] => Array
    (
    [artist] => Led Zeppelin
    [title] => Since I've Been Loving You
    [file] => http://www.tracyfu.com/projects/wordphonic/mp3s/03.mp3
    [image] => http://www.tracyfu.com/projects/wordphonic/images/03.png
    )
    )

    )

    It's printing this:

    (
    [default] => Array
    (
    [1] => Array
    (
    [artist] => A
    [title] => A
    [file] => A
    [image] => A
    )

    [2] => Array
    (
    [artist] => A
    [title] => A
    [file] => A
    [image] => A
    )

    [3] => Array
    (
    [artist] => A
    [title] => A
    [file] => A
    [image] => A
    )
    )

    )

    -----

    I can't figure out for the life of me why... The data is coming from input fields that look like this:

    <input type="text" name="ephonic_playlists[default][1][artist]" />

    And, when I look in the DB the data is serialized correctly. The only thing I can think is that the array must read "Array(...)" and it's only reading the first 'A', but I really don't know...

    Please help anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic