S
S
svetlov972019-04-12 04:52:03
PHP
svetlov97, 2019-04-12 04:52:03

What is the equivalent of string_to_array from postgreSQL for SQLite?

Actually the question is in the title. The bottom line is that the execute method in PDO on a named marker does not accept an array. But I know that postgreSQL has a string_to_array method, but I can’t google the analogue in SQLite. There is not one named marker, there are 2 of them and each has different data. Tell me how to get out.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Bragin, 2019-04-12
@aywan

PDO knows nothing about what postgresql can do with arrays.
If you need to save an array and maintain compatibility with multiple databases - then use serialize / deserialize, or even better json_encode / json_decode. Store the field as text.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question