Zabs
Zabs

Reputation: 14142

PHP unserialize error

I am getting the following error :-

Message: unserialize() function.unserialize: Error at offset 65517 of 65535 bytes

Does the unserialize have a maximum size?

Here is the line in question within my PHP:

$array = unserialize($emails);

// this is the output of $emails (not all of it as it is huge)
string(65535) "a:12134:{i:0;s:29:"[email protected] ";i:1;s:31:"[email protected] "

Upvotes: 1

Views: 7573

Answers (2)

Aris
Aris

Reputation: 5057

You probably store this in a TEXT field in the mysql database. It's maximum size is 65,535 bytes, as in your error.

You can use MEDIUMTEXT, which is the next available.

enter image description here

Upvotes: 3

Narf
Narf

Reputation: 14752

The database field (presumably) that you're storing your serialized data into has a size limit which is exceeded by the length of that string - basically, your data is corrupted.

Upvotes: 14

Related Questions