Call to a member function get_results() on null
-
Hello everyone,
I need to access a table in my database from a php file. I begin my PHP file withglobal $wpdb;
and try a simple search$myrows = $wpdb->get_results( "SELECT * FROM my_table" );
I get the following error :Uncaught Error: Call to a member function get_results() on null
as if my table was unknown.
I tried with other tables and had the same result.
Do you have any clue why it does not work ?
ThanksThe “whole” code :
<?php global $wpdb; $myrows = $wpdb->get_results( "SELECT id FROM db_rcp_payments" ); ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Call to a member function get_results() on null’ is closed to new replies.