WP Meta Query - 将LIKE / IN序列化字符串与数据库中的序列化数组进行比较

I am trying to bring through content based on a unique GUID. The database is stored in a serialized array and this cannot be changed.

An example record would be:

a:1:{i:0;s:8:"16YL3332";}

And I currently use this in WP to serialize the string and run it in get_posts function using the following args

    $guid serialize(strval($_GET['guid'])); // var dump = string(15) "s:8:"16YL3332";"
    $args = array(
        "post_type" => "custom-post-type",
        "post_status" => "publish",
        "posts_per_page" => 1,
        "meta_query" => array( 
            "key" => "_fixtures",
            "value" => array($guid),
            "compare" => "LIKE"
        )
    );

I am having no success in bring the appropriate data back. WP defaults to bring back the most recent content published in the post type.

Why are you casting the $guid variable to an array? I'm not sure that's needed. If you just pass it as 'value' => $guid, does that work?

Also, see the following QA for some more information that may help you:

https://wordpress.stackexchange.com/questions/115833/how-do-i-search-an-array-stored-in-a-custom-field-using-wp-query