Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 615269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:12:07+00:00 2026-05-13T18:12:07+00:00

Hi guys I’m in an emergency here. My code was working FINE for a

  • 0

Hi guys I’m in an emergency here. My code was working FINE for a while when ALL of a sudden somethings gone wrong and I havent a clue what! I store an object in my database by serializing it and then running a base64_encode on it. The result is an encoded serialised string which when I wish to retrieve I just decode and unserialise it.

Its been working fine but all of a sudden I have no idea why – whenever I try to run the part which does the insertion – it encodes the object corrrectly but after running the sql query – the value which ends up in the database is a truncated mess!!!!

Its not a database issue for if I manually copy paste the encoded string in the field it copies and is inserted fine.

I have no idea whats going on – the code below is how I’m making the update:

$personsTable = new ZFltData_Db_Table(array('name'=>'people'));
$where = $personsTable->getAdapter()->quoteInto('id = ?', $id);
$data['object'] = base64_encode(serialize($obj));
$personsTable->update($data, $where);

The database field is actually a longText.

EDIT ====
Sorry bout that. Well the encrypted string looks like this:

YToyOntpOjA7YTozOntzOjg6ImNhdGVnb3J5IjtzOjU6InBob25lIjtzOjQ6InR5cGUiO3M6NDoiV29yayI7czo3OiJkZXRhaWxzIjtzOjEzOiIxMjMzIDQzNTQzNTQ1Ijt9aToxO2E6Mzp7czo4OiJjYXRlZ29yeSI7czo1OiJwaG9uZSI7czo0OiJ0eXBlIjtzOjQ6IkhvbWUiO3M6NzoiZGV0YWlscyI7czoxNzoiMTAwOTEyIDgwOTgxMjkwMTIiO319

It loks that way if I manually copy paste it into the database using Navicat explorer.

However the code when executes ends up putting just the following in the database:

Tjs=

Weird part is that this is all that is entered no matter what the contents of the object encoded…the object is actually an associative array… whats wrong here? It was working fine until… just today…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:12:07+00:00Added an answer on May 13, 2026 at 6:12 pm

    Tjs= base64_decodes to N;, which is the serialized representation of null.

    So, $obj is null in your script at the point you serialize it, and not an associative array.

    It’s impossible to tell why that is, because we don’t know where $obj comes from. If it’s something you are working with further up in your script, make print_r() tests to see whether it gets overwritten somewhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

guys. I have two view controllers with two uiwebviews. Here is my code: First
Guys here is my html form code. What I want is when I click
guys, I would like to you evaluate next code below. As you see, I
guys. I have UITableView with different cells and I have code, which counts height.
Guys that is code copied from a book (Programming Windows 5th edition): #include <windows.h>
Guys, I am using dynamic programming approach to solve a problem. Here is a
Guys, I'm trying to write xpath or css to find/click on list element All
guys. I'm working on some audio services on iOS. I trying to search any
Guys I've a Situation here.. I've Developed a Website using C# .Net framework 4.0,
Guys I've a situation here, I've a HTTP handler ( InsertMap.ashx ) to save

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.