How do I save data from a given field as an array in the database and then print it?

I have a table with two products:

Array
(
    [3] => Array
        (
            [1] => 12
            [2] => 4
            [3] => 3
        )

    [5] => Array
        (
            [1] => 12
            [2] => 1
        )

)

How do I save the array in the database and then print it in the following way:

[1] - 12 бр.
[2]- 4 бр.
[3] - 3 бр.

[1] - 12 бр.
[2] - 1 бр.
"color" - "quantity"
[1] - 12 бр.

I swear I have been over this recently…

I found how to do it … I used serialize () and unserialize (). the good thing is that it allows you to record accurately and then bring it the same

No you didn’t. Lets start with posting the actual tables and how you are coming up with the array along with a description of the real problem you are trying to solve instead of your attempt at solving it.

Your question is not clear. Please explain me more. What is your issue?

Sponsor our Newsletter | Privacy Policy | Terms of Service