global $wpdb
-
I am a newbe and I am trying to create a php file all on my own, and I would like to do a simple test to see that I have connected to my database correctly. And here is the code I am using to do the test…
<?php
global $wpdb;$query = $wpdb->get_results(“Select post_title, ID, post_content, post_date, comment_count, iphone_image FROM wp_posts”);
blah-blah-blah…….
echo….blah-blah-blah.
?>I get an error :
Fatal error: Call to a member function get_results() on a non-object in /home/mysite/public_html/wp-includes/stuff/remote/tester.php on line 4I have done everything I can find in this forum, and I probably don’t have it globalized properly…can someone tell me what to do?
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘global $wpdb’ is closed to new replies.