2
I am needing to save an array in a field in the database table and would like to know how best to do this by using the serialize()
and unserialize()
or json_encode()
and json_decode()
.
I know you have other alternatives for this as well, such as being able to use the explode
and implode
or even better create another auxiliary table for this, but this option to create the auxiliary table has already been discarded and the other I think would be the worst option.
you will need to do research in this field?
– rray
in this field in particular will have only numbers, which by the way, in each should not exceed 3 items and yes, it may be that I have to search in this field and for that I thought to use a like and it is certain that I will not need to do any Join.
– Marcelo Diniz
There is a basic concept of not working what you don’t need, and depending on the functions you have described, you should use the most convenient for the type of data you want to work with. Since you put the tags php, mysql, it would be good to see a part of the code in question, so that we can better understand what it is.
– Edilson