[Resolved] $wpdb-> query and $wpdb->get_col strange result
i’m looking for help with $wpdb->query and $wpdb->get_col.
I’m trying to get id’s of my posts from table wp_posts.
but when i run
$wpdb->query("SELECT id from wp_posts")
i get just first id, and when i use
$wpdb->get_col("SELECT id FROM wp_posts",0);
i got over 300 ids, while i have only 30 posts(tho the rest are revisions and autosaves from this 30 posts).
i tried to use $wpdb->prefix and $wpdb->posts but effect was the same.
I’d appreciate any help.
- The topic ‘[Resolved] $wpdb-> query and $wpdb->get_col strange result’ is closed to new replies.