wordpress $wpdb queries
-
I have wordpress 3.8.1
For the most part, the site runs fine, but when I try to make my own queries on a table I created, the wpdb object is not working as expected.
In php admin, I can see table playlists with 4 rows, but the WordPress database functions don’t find any rows$sql=”SELECT * FROM wp_playlists”;
$playlists = $wpdb->get_results($sql);This returns an empty array
$playlists:0 rows
Array
(
)Another example:
$playlists = $wpdb->query( “SELECT * FROM wp_playlists”);
$playlists:[4];Instead of returning all the fields of all the rows, it simply returns the number of rows.
What could be causing this problem?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wordpress $wpdb queries’ is closed to new replies.