admin管理员组文章数量:1122832
I'm running the following query to get attachment data for a long list of post ids:
SELECT post_id, post_title, meta_key, meta_value
FROM wp_postmeta JOIN wp_posts ON wp_postmeta.post_id = wp_posts.ID
WHERE post_id IN ('list', 'of', 'around', '2500', 'post', 'ids', ...)
AND meta_key IN ('_wp_attachment_metadata', '_wp_attachment_image_alt', '_wp_attached_file')
Making this query with $wpdb->get_results($query, ARRAY_A)
returns an empty array. But when I run the exact same query in phpmyadmin, I get results.
Wordpress docs say that an empty array is returned when there are no results, or when there is a mysql error, but $wpdb->last_error
is empty. Is there is a limitation in $wpdb regarding query length (I'm not seeing anything in the docs)? Any ideas?
本文标签: mysqlwpdbgtgetresults() query emptybut same query in phpmyadmin has results
版权声明:本文标题:mysql - $wpdb->get_results() query empty, but same query in phpmyadmin has results 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301042a1931039.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论