apologies that this is very basic stuff but would really appreciate some help. I am trying to query a table in my Wordpress database by adding the following to my child theme's functions.php
$myresults = $wpdb->get_results("SELECT id FROM wp_my_table WHERE user_id=1");
I am trying to view the results of the query by adding
<?php
var_dump($myresults);
?>
to one of the pages on my website, but it just displays 'NULL'. I have checked using phpMyAdmin and wp_my_table definitely exists, and contains entries where user_id=1. Any ideas?