Support

Home Forums Event Espresso Premium Understanding table esp_transaction column TXN_session_data

Understanding table esp_transaction column TXN_session_data

Posted: November 29, 2015 at 7:10 am

Viewing 3 reply threads


Jeff Long

November 29, 2015 at 7:10 am

Hey EE team,

I’m trying to learn how to work with the entries in the TXN_session_data column of the esp_transaction table in EE4.

Can you give me a breakdown of proprietary formatting you may have in the entires that get generated?

Can you point me toward any WordPress Codex resources, or EE resources that document the style of data storage that you are doing here?

a:11:{s:2:"id";s:32:"d3eaf8de0410d6c3fc7d20906de89e36";s:7:"user_id";i:0;s:10:"ip_address";s:14:"107.132.185.33";s:10:"user_agent";s:120:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36";s:11:"init_access";i:1446469084;s:11:"last_access";i:1446470408;s:10:"expiration";i:1446472685;s:13:"pages_visited";a:0:{}s:4:"cart";N;s:8:"checkout";N;s:11:"transaction";N;}

Something like the following would be really useful.

a // means what in this position?
: // means what in these expressions?
11 // in this position - what are the digits signifying?
{ // encloses the metadata
s // means what here?
: // means the same thing everywhere?
ETC

Thanks!


Tony

  • Support Staff

November 30, 2015 at 4:32 am

Hi Jeff,

That’s a serialized array.

Basically it’s a way of storing complex data within the database. You can’t store an array (or object) within the database as is, you need to serialize it and store it in the format above, then when you want to alter it, you need to retrieve it, unserialize it and work with the array (or Object) again.

Take a look here:

http://php.net/manual/en/function.serialize.php
http://stackoverflow.com/questions/8641889/how-to-use-php-serialize-and-unserialize
http://www.hackingwithphp.com/5/11/0/saving-arrays
https://codex.wordpress.org/Function_Reference/maybe_serialize

As a starting point.

A breakdown of what each letter means can be found here:

http://php.net/manual/en/function.serialize.php#66147


Jeff Long

December 2, 2015 at 8:51 am

Perfect! Thank you, Tony.


Tony

  • Support Staff

December 2, 2015 at 9:00 am

You’re most welcome, Jeff 🙂

Viewing 3 reply threads

The support post ‘Understanding table esp_transaction column TXN_session_data’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso