• I think you have a bug in your scan postmeta query.

    This is the current query:

    
    SELECT meta_value FROM wp_postmeta
    			WHERE post_id = ?
    			AND meta_key = '_thumbnail_id' OR meta_key LIKE '%gallery%' OR meta_key LIKE '%ids%'

    This query will fetch all rows matching post_id AND meta_key = ‘_thumbnail_id’. It will also fetch every row with meta_key like gallery or ids without taking into account the specified post_id.

    I think the correct query will look like this:

    
    SELECT meta_value FROM wp_postmeta
    			WHERE post_id = ?
    			AND (meta_key = '_thumbnail_id' OR meta_key LIKE '%gallery%' OR meta_key LIKE '%ids%')
  • The topic ‘Bug on query’ is closed to new replies.