Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8110771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:52:29+00:00 2026-06-06T01:52:29+00:00

I have serialize values in data base, i fetch them from database then when

  • 0

I have serialize values in data base, i fetch them from database then when i do

<pre>
print_r($DataValues)
</pre>

it shows me value like this

[0] => stdClass Object
    (
        [categories] => a:1:{i:38;s:21:"Summer Market Session";}
    )

[1] => stdClass Object
    (
        [categories] => a:1:{i:38;s:21:"Summer Market Session";}
    )

[2] => stdClass Object
    (
        [categories] => a:2:{i:38;s:21:"Summer Market Session";i:39;s:21:"Autumn Market Session";}
    )

i want to get only the value after unserializing it, i tried to unserialize but is show bolean false

& when i try to print the value after running for each value it shows me below mentioned error

Catchable fatal error: Object of class stdClass could not be converted to string

I dont know how i do this i was trying all unserialize tactics what i know & also i tried to store value in array by using foreach loop but i am fail..

Kindly help how can i get value of it after unserilize it…??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:52:30+00:00Added an answer on June 6, 2026 at 1:52 am

    Well, somehow I still can’t see the problem. I’ve reconstructed the data structure you seem to get from DB with this:

    $testObject             = new stdClass();
    $testCategories         = array(38 => 'Summer Market Session');
    $testObject->categories = serialize($testCategories);
    
    $anotherTestObject             = new stdClass();
    $anotherTestCategories         = $testCategories;
    $anotherTestCategories[]       = 'Autumn Market Session';
    $anotherTestObject->categories = serialize($anotherTestCategories);
    
    $dataValues = array(
      $testObject, clone $testObject, $anotherTestObject
    );
    
    print_r($dataValues);
    

    It gave me the same output you’d quoted in your question, so I guess that’s a correct reconstruction. To unwrap this data back, simple loop sufficed:

    foreach ($dataValues as $dataElement) {
      $categories = unserialize($dataElement->categories);
      print_r($categories);
    }
    

    Or am I doing something wrong?

    Anyway, here’s a sandbox to check all this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a generic handler (.ashx) to fetch some database values using jquery
I am trying to make some data from database available using XML, I have
I have to serialize & desserialize json data. if the data type was XSD,
I have some data that I have to serialize to JSON. I'm using JSON.NET.
I have a DOM Document created from scratch and I need to serialize it
I have some binary data produced as base-256 bytestrings in Python (2.x). I need
I have some jquery that inputs text into a database and then clears the
I have a data table in my database where I store various settings. Since
My iphone app uses a SQLite database to store data. I have a table
I am trying to export data from my MySQL database to multiple CSV files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.