I am still working on my first plugin and am at the point where I want to get a single value from a table created by another plugin. Their table has six columns named blog_ID, level, expire, gateway, term and amount.
Retrieving Data From Single Cell In Wordpress MySQL Table
3
I am still working on my first plugin and am at the point where I want to get a single value from a table created by another plugin.
Their table has six columns named blog_ID, level, expire, gateway, term and amount.
I am interested in using the first three ... blog_ID, level and expire. blog_ID and level are numeric values. expire is a unix (or linux) epoch date/timestamp.
I am struggling to display the level associated with a particular blog_ID. Later, I hope to evaluate whether the expire field is greater than the current epoch date/timestamp or not.
In the code below, all goes fine until I try to display the value. My result is showing as 'ARRAY.'
What do I need to do to display the value of the 'level' field for a blog with an id equal to the value held in $thisblog?
Thanks in advance!
Their table has six columns named blog_ID, level, expire, gateway, term and amount.
I am interested in using the first three ... blog_ID, level and expire. blog_ID and level are numeric values. expire is a unix (or linux) epoch date/timestamp.
I am struggling to display the level associated with a particular blog_ID. Later, I hope to evaluate whether the expire field is greater than the current epoch date/timestamp or not.
In the code below, all goes fine until I try to display the value. My result is showing as 'ARRAY.'
Code:
<?PHP
// Testing by Kirk
global $blog_id;
global $wpdb;
$thisblog = $blog_id;
echo ('Blog #' . $thisblog);
?>.' is at Level #'. <?php
$res = $wpdb->get_results("SELECT level FROM wp_pro_sites WHERE blog_ID = '$thisblog'");
echo $res;
?>
<br /> Thanks in advance!
- cgimaster
- SteveJohnson
Next Topics on Trending Feed
-
3