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

  • SEARCH
  • Home
  • 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 6963511
In Process

The Archive Base Latest Questions

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

I am building an associative array of information and then adding it to a

  • 0

I am building an associative array of information and then adding it to a history array by doing $histarray[] = $histrec;

I am then writing the $histarray to mysql by doing serialize($histarray). I defined the field that I am writing to as a text field. The unserialize command quit working when the variable got quit large, > 64k and when I looked, the data is getting truncated. I rewrote my functionality to serialize and write the $histarray to a folder and then read it and unserialize it. This does not cause the same problem and works well.

I have 2 questions.

  1. I assume that the mysql database or the php write to it is truncating the serialized data, but what specifically is causing this? I thought a field that was defined as text was basically unlimited in size.
  2. Is it faster to just read and write a file to a folder in this situation rather than store this info in a MYSQL table. It is only temp session data and does not need to be stored.
  • 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:48:07+00:00Added an answer on May 27, 2026 at 3:48 pm

    1. I assume that the mysql database or the php write to it is truncating the serialized data, but what specifically is causing this? I thought a field that was defined as text was basically unlimited in size.

    Strings in PHP are generally not limited in size (theoretically, factually there is always a limit on something). But really, strings in PHP can be really large. The PHP string limit is not a problem here.

    A field in the database however has a size limit. You might want to use a BLOLB type field for large data, or a LONGBLOB or however it is called in MySQL: http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html

    MySQL truncates when the field can’t take all (instead of not updating/inserting).

    2. Is it faster to just read and write a file to a folder in this situation rather than store this info in a MYSQL table. It is only temp session data and does not need to be stored.

    If you don’t need to store at all, fastest is to not store: Not in the db nor in the filesystem.

    If you actually need to store, it depends what is faster on your system configuration. Both can be pretty fast, database and file-system.

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

Sidebar

Related Questions

i need help building a function that display an associative array and i want
I have query building plsql code. I use bind variables and associative array to
building a site using PHP and MySQL that needs to store a lot of
I'm parsing out an HTML table and building an array based on the row
I'm building off the CakePHP tutorial for the blog engine by adding comments to
I would like to create an associative array in R from a string like
I am building a tree-like data structure out of associative arrays. Each key is
I'm trying to build a multidimensional associative array while fetching the results from a
Building on How Do You Express Binary Literals in Python , I was thinking
Building a client-side swing application what should be notified on a bus (application-wide message

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.