Solved

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

Posted on 2011-09-29
3
2,404 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
  • 2
3 Comments
 
LVL 108

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 108

Expert Comment

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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Are you using email marketing software? If not, you're missing out on effortless marketing and the reaching of desired conversion rates through email marketing software.
This article discusses four methods for overlaying images in a container on a web page
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now