Solved

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

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

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 109

Expert Comment

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

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I think I know what this error means, but I need some other eyes on it... 32 52
PHP and JQuery Syntax question 4 26
Help with PHP 13 27
selector:validator cookies 4 30
E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

821 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