mysql select query within a serialized array

前端 未结 14 1309
忘了有多久
忘了有多久 2020-11-29 07:51

I\'m storing a list of items in a serialized array within a field in my database (I\'m using PHP/MySQL).

I want to have a query that will select all the records that

14条回答
  •  执念已碎
    2020-11-29 08:09

    You may be looking for an SQL IN statement.

    http://www.w3schools.com/sql/sql_in.asp

    You'll have to break your array out a bit first, though. You can't just hand an array off to MySQL and expect it will know what to do with it. For that, you may try serializing it out with PHP's explode.

    http://php.net/manual/en/function.explode.php

提交回复
热议问题