Solved

Help solving Notice: unserialize() [function.unserialize]: Error at offset with OpenCart Additional tabs

Posted on 2011-09-29
3
2,499 Views
Last Modified: 2012-05-12
Im currently developing a site, that has a module that seems to work until too much information is put into the database field.

The developer is storing data in this field with separators that are exploded into an array and iterated on the web page.

Though, when adding a lot of data, I get this error Notice: unserialize() [function.unserialize]: Error at offset 29755 of 65449 bytes in ......

Ive tried changing the type of database field from utf8_bin to utf8_general_ci and that didn't work. I also checked to make sure something like that & signs were set to & in the html data it had, but still no luck. I do have a URL for preview if needed.

0
Comment
Question by:webrhp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 36890803
The developer is storing data in this field with separators that are exploded into an array and iterated on the web page.

If I understand that statement correctly, it sounds like the data base design is not technically competent.  It is true that you can store more than one field in a column of a data base, but it is not normal, and it is sometimes unwise to do that.  A better design might be to have a separate table for these data items, and join the tables when the query is executed.  

Unserialize() and Explode() are different PHP functions, and while they do some things similarly, it appears that the Notice is having difficulty with the former function.

To give you anything specific we would need to be able to see the data string that is causing the Notice.  Probably we would want to see the code that shows how it was created, too, along with the input data to that code segment.
0
 

Author Closing Comment

by:webrhp
ID: 37056566
Thank you for your reply, and it seems you are correct. In fact, it seems my error was because there was too much data in the field. Once I stripped the HTML's white space, and minimized the number of lines, the error disappeared.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 37058013
Thanks for the points - glad it's working well, ~Ray
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How important is it to take extra precautions to protect your online business? These are some steps you can take to make sure you're free of any cyber crime.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question