Solved

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

Posted on 2011-09-29
3
2,524 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article was initially published on Monitis Blog, you can read it here . When it comes to deciding which approach to website performance monitoring is best for your business, unfortunately, like so many options in life . . . it depends. In th…
This article discusses how to implement server side field validation and display customized error messages to the client.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

623 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