WPDB Database Query fails
-
Does anybody know why this code returns an empty array, even if there are static pages with an ID different to 0?
Code:
$query = "SELECT * FROM " . $wpdb->posts . " WHERE post_status='static' AND post_parent <> 0"; $pages = $wpdb->get_results($query);
$wpdb is global, if I do an echo $query for debugging reasons, it shows me the complete and correct MySQL-query. But $pages is always an empty array.
This error only occurs when post_status=’static’ is included. Can anybody tell me why?Please help!
greetings from Germany, Thomas
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WPDB Database Query fails’ is closed to new replies.