N
N
nepster-web2014-12-17 02:27:40
MySQL
nepster-web, 2014-12-17 02:27:40

How to get multiple records from serialized data using sql?

There is a table in which the data field (longblob data type), user sessions are stored in it.

__flash|a:0:{}user.attribute|s:3:"---";__id|s:1:"1";

How can I get records of specific users by id (__id) ?
Perhaps this can be done using yii2 (I did not find it in the docks).
For example, I want to find records of user sessions with id 1 and 7 and log them out.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vit, 2014-12-17
@nepster-web

The only normal solution would be to have a separate column with user_id.

A
Alexander Aksentiev, 2014-12-17
@Sanasol

Brute force -> unserialize -> log out
Or pervert with a like request, the first option is easier

I
Immortal_pony, 2014-12-17
@Immortal_pony

Search using regular expressions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question