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 6963001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:43:57+00:00 2026-05-27T15:43:57+00:00

I am saving data in a mysql database. This data is an array and

  • 0

I am saving data in a mysql database. This data is an array and the content is different data of the current user that is logged in to my system.

I do this when I save to the database:

$data = addslashes(serialize($array));

then

"UPDATE or INSERT INTO TABLE SET ... data = '$data';"

Now, the data are saved correctly since the insert or update statement return valid from my php code.

My problem is when I try to un-serialize it, it returns false and a notice is shown in my page.

What am I doing wrong?

  • 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-05-27T15:43:58+00:00Added an answer on May 27, 2026 at 3:43 pm

    I will bet the field in your mysql database is not big enough to save all the characters. That is why, when you un-serialize it you get an notice and nothing in return.

    Try to increase the field to a MEDIUMBLOB or MEDIUMTEXT (maximum length of 16,777,215) or LONGBLOB or LONGTEXT (maximum length of 4,294,967,295) like this:

    ALTER TABLE your_table MODIFY COLUMN column_name MEDIUMTEXT /* other properties*/;
    

    And try to save and read your data again.

    Now, if your data is over 4,294,967,295 (which is LONGBLOB or LONGTEXT), maybe you should check what kind of data you saving and maybe filter or remove unwanted some.

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

Sidebar

Related Questions

I am saving data to a mysql database and these are going to be
When saving data in different sql tables, is it best to use the GUID
I really like Xml for saving data, but when does sqlite/database become the better
I have a action class for saving some data to a database.In action class
I want to do encode the data before saving it to a database table
What's the best way to save my MySQL data model and automatically apply changes
Hi I am saving mostly english and german characters into a mysql database which
I am attempting to store files in a MySql database based upon this article
I have an application that needs to save a large number of this type
I am saving a serialized object to a mysql database blob. After inserting some

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.