Ajax $wpdb not returning table data
The main problem, I see in your code, is that you use query method of wpdb and assume that it is PDO statement object… But it is not. Take a look at wpdb Codex: https://codex.wordpress.org/Class_Reference/wpdb query method is used to run custom queries on DB – that’s all. What you want to use is get_results. … Read more