Getting results from WP database
-
Hi WP-ists….
I writing a simple plugin for WordPress, albeit slowly.
I’ve got it writing to the database, but it’s getting the info out that I can’t seem to do
In my brain, this should work:
function displayCatImg(){ global $wpdb; $getImg = $wpdb->query("SELECT imageurl FROM wp_blogcathead WHERE id = '7'"); echo $getImg; }
Basically, it should pull a URL from a new table in the WP database.
Do I need to use foreach?
There is only one value being taken from the database though.Should I be using something other than echo?
Anyone? Class? Anyone?
Cheers
Toby
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Getting results from WP database’ is closed to new replies.