Using wpdb->wp_query with wp_remote_post
-
Hi,
I am using the HTTP API wrapper function wp_remote_post on Site A to trigger a function in the functions.php file of a separate wordpress installation on Site B (two different servers).
The function on Site B triggers fine and returns values as expected. Now I wish to return information from a custom table in the wordpress database of Site B. I am currently trying to use the following in functions.php on Site B:
add_action('template_redirect', 'process_post_request'); function process_post_request(){ if( $_POST['action'] == 'get_job_posts' ){ global $wpdb; $jobs_list = $wpdb->wp_query( "SELECT job_title FROM $wpdb->wpjb_job LIMIT 5;" ); if ( $jobs_list ){ // do stuff with results of query here } die(); } }
The problem is that when it hits the line containing the query it throws an error:
Call to undefined method wpdb::wp_query()
Why isnt this query call being recognised? What am I missing?
Any insight much appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Using wpdb->wp_query with wp_remote_post’ is closed to new replies.